Fix not recording initial frames as seen-before, and add a test that exercises frame-handling code by doing a maybe-mod against different stack frames or the heap.
Implement shared CoW tree to represent globals and heap.

Configurable tree order is currently set to 16. Heap writes break only log16(heapsize) nodes; reads cost log16(heapsize) lookup steps; merges sort+unique at each level in the tree to avoid CoW breaks against unmodified subtrees.