Storage and control for undo information within a CodeMirror editor. 'Why on earth is such a complicated mess required for that?', I hear you ask. The goal, in implementing this, was to make the complexity of storing and reverting undo information depend only on the size of the edited or restored content, not on the size of the whole document. This makes it necessary to use a kind of 'diff' system, which, when applied to a DOM tree, causes some complexity and hackery.