Fixes for GTK+ 3.14

Hi,

Here are some updates to support features of GTK+ 3.14. As you know already, they've changed the internals significantly, so many things had to be rewritten.

I hacked this as a single commit initially, and then have split the changes into individual commits, so if I forgot the details and have split them incorrectly, try to figure that out :)