undo: fix bug with undoing deletion of a root-level tree

Previously, the clone() would make prev() return null, thus negating an
important piece of data for the undo algorithm.  The upshot was that the
tree would be reinserted at the end of the file, instead of its proper
place.  Now we clone unconditionally, after calling prev().  This is
less efficient, but bug-free(?).

addresses #66