Repository API refactoring and cleanup.
Merge pull request #25 from sumerjabri/master

Repository API refactoring and cleanup.
Merge remote-tracking branch 'upstream/master'