Adjust to new way to access GLib

This supposedly fixes #13. I haven't checked whether the preferences are working at all.