Derive version number in a Git-based way. Cleaned up some junk left over from olden times.