Move memdb to a ns, split out the file ops.
Basic json encoding for ring.