Improve mapping for more functions.

I moved the module definition to its own file because I think it's more convenient.
yes, result is an error flag, while err is a `<git-error*>`