Abstract storage

Hi Geoffrey,

These changes are aimed at making a formal API for backend storage classes, and if they are acceptable I would like to work on a SQLite backend to live alongside the existing MongoDB backend.

Thanks for making leselys,

David B.