The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
If you're comfortable replacing this with an explicit check that the file exists that would also be good. IOError is a bit less concerning than the other two, though