Rewrite the in-mem storage as a backend for the cassandra storage
There is a lot of duplicated logic between the two; and we can rewrite just the data access bits and share the logic between the two.
(work initially started at !407 (closed) a few months ago, but I rewrote it as a bunch of smaller diffs, attached to this task)
Migrated from T2519 (view on Phabricator)