Add generated files to gitignore

Add generated files from autotools, build, dist, and gtk-doc.
Add an abstraction to the GLib main loop

Add a function to start and quit the GLib main loop as convenience
functions for scripting.