Massive refactor to use in-memory database for testing and so allowing for real implementation of Store.