Removing some unnecessary methods
Alloc undoManager on the fly.
This prevents the undoManager being allocated for search documents since they have their own undo manager.