Patch Set 1: I would prefer that you didn't submit this

You should refactor the Repository API first. Most of the other functions now changed don't need a FileRepository.

1. Extract a prelimninary Repository API into an interface
2. Rename the impleementation class
3. Clean up API. This probably takes more than one step to get it right.