Refactor git

extract logic out of cli and into git class.

also, change from Grit library to Rugged git library.