Wrap including glib.h in order to suppress warnings.
Re-structure the way flag variables are defined.
Fix the tests and flush out the types more.