Initial work on GUI + some core changes

This is what I've managed to do today, it's pretty stable with minor quirks. All basic features should work using the GUI. Read the commit descriptions for details.
Sorry if I've messed up any formatting, I will clean it up later :)

Oh, I guess I should put this in the library, otherwise we're doing it once for each front end.

Our build/release system adds a `git describe --long` style version number, so we know the human readable release, if there have been any commits since then, and also the exact git commit it was built from.