The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
`sorted(set(all_symlinks) - set(broken_symlinks))` replaces this and the next line