Clean up lib/git.js
Fix almost everything.