Move git versioning code into a plugin.

Will pull this out into a proper plugin shortly, just wanted
to get it structured right and working.