Add a memory-only mode

If `only_memory` is set, do not access the disk in any way.