Capture cursor registration for undo event even when not in edit mode

Any cursor add or removal commands should be tracked for the purposes
of restoring the document state. If a cursor operation is missed, the
document will not re-add the cursor after an undo operation.
Don’t reset the undo manager state when entering or exiting edit mode

This allows consumers to enter and exit edit mode multiple times without
the undo stack being reset. Once the initial undo state has been captured
after the document is loaded, there is no major problems with preserving
the undo state (other than the undo manager’s shameful performance).
Clarify names & usage of the undo manager
Merge pull request #297 from peitschie/unbreak-undo

Undo fixes and a (tiny) behaviour adjustment