Refactor add_and_commit method

Was trying to improve readability and reduce complexity of this method.
Introduce a new class module Repository for adding and committing.
Add Tests for the new class.
What do you think? 

(CodeClimate thinks this is an improvement ;) )