The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
Parallelism definitely isn't needed given the speed of the operations