Build in version number at compile time.

Prints version number at startup, will make collecting bug reports a
little easier. Closes #338.
Now depends on git during build to get the version. There's not
currently a tarball release process, so that shouldn't be an issue.
metadata: fix compile warnings