Add status query for staged files

This allows clients to determine whether a path is in git's index.
Fix Repository::Add to write index changes to disk

Without this, changes are not visible outside of the node process,
and seem to be lost. This makes the changes persistent.
Merge pull request #37 from jrkoenig/master

Add status query for staged files