Fix git merge 

1) Fixes various typeError bugs thrown in checked mode.
2) Fixes a bug in writing shaString instead of shaBytes.
3) Adds functionality to commit a given tree object.
4) Fixes nits and small bugs.