UndoManager: improve doc
UndoManager: update_can_undo_can_redo() utility function
UndoManager: another batch of code clean-up