The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
Good idea. Done, and also added copious comments and examples, and broke out the find command generation into a separate method.