Fix GitAdd and GitRemove tools not working on Mac OS X.

+ some refactoring.