Refactor StorageManager and add tests
Merge pull request #357 from inthause/documents

Refactor StorageManager and add tests