General cleanups

This first batch of fixes aims at getting rid of lots of warnings (glib function deprecation, gcc warnings) before I tackle the actual bugfixes.