sophia: add basic lowlevel datastructures to support snapshotting; tests