The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
I'm assuming the key is a hex string since I haven't read the content store code yet. This check would be stronger as a regular expression