Adding to the index of a bare repository.

Using add() on the index of a bare repository is currently not possible. There seems to be no reason for this however, as the relevant code is implemented without touching the working tree directory at all.

This pull request mostly moves the working tree specific code to separate methods. This way @git_working_dir is only used when actually needed, and this way add() works on bare repositories.

One additional problem that might need some attention and/or fixing is the "rw_bare_repo._working_tree_dir = None" line in the test. I'm not exactly sure why the code still thinks there is a valid working directory after cloning to a bare copy.