Refactor in-memory entries, add snapshotting.