Refactor git

extract logic out of cli and into git class.

also, change from Grit library to Rugged git library.

<!---
@huboard:{"order":5.0,"custom_state":""}
-->