Add repository object. Add local/session/json storage repository mixins.

Still have a few things to do but just want to check I'm on the right lines.

Still to do:

* Tests
* HttpRepository
* REST Repository (?)