The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
I prefer these names for symmetry with the names I give them in status(). And I use the short names there deliberately, because (n, n - b, b) looks a lot better than (all_files, all_files - unsynced_files, unsynced_files).

All style rules have exceptions, and this feels like an appropriate one for allowing single character var names for what are basically just notations.