The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
It might be good to collect all of the errors and then raise an exception with everything so that the user doesn't need a new run for each error