Bug fix: clearNodeEdgeMemo needed for valid IDs

Thanks to Jim Allman for reporting this. When I moved
to using user-controlled id generation, I used some
memory address to ID lookups. I forgot that the nodes
and edges of the trees are not all instantiated at the
same time (to avoid having all of the trees in memory at
the same time). That means that you could get bogus
hits in the nodeToId and edgeToId maps. Calling
clearNodeEdgeMemo for each tree solves this.