Implement GCleanup in libglib
Submitted by Stef Walter
Link to original bug (#711744)
Description
Implement GCleanup in libglib and associated tests.
I've split this out from bug #627423 for simplicity, since there are quite a few patches. That should make it easier to review, track dependencies and so on.