Refactor the InMemoryCollectionBackend

Currently the row and store collections share a lot of functionality and it's a little tricky to construct suitable test data for use in tests. We should simplify the expected in-memory dict and re-use the shared code (possibly by having a key creator function passed into the in memory store constructor).

Part of #4.