Add disk backing option to MemoryDatabase
Refactor PersistedMemoryDatabase code and add a unit test