Fix tests for the memory backend
Fix computation of keys from a buffer
Fix serialization of values to disk
All tests pass (in-memory + on-disk)