Enable git.add() and git.rm() to handle multiple files without getting a lock.

I rewrote the add() and rm() functionality so that, when adding (or rm-ing) multiple files from a pipe, the repository is not locked halfway through and only half work is done. The code is inspired by how commit() is implemented.

I also added two unit test for them, which both succeed (at least on my machine :) )