Adding undo and redo.

This involves adding transactional semantics to all commands that modify
data.  This is explicitly *not* optimized right now, but is instead as
simple as possible.  If it proves damaging in the immediate term, we can
easily bound the size of the undo/redo stack.

Undo/redo are CTRL + Z and CTRL + Y.  As far as I can tell, they work, with no caveats.

This builds off the commit that fixes deletion at end of line.