Refactor Gitlib to use a MonadGit r m type class