Added document specific undo functionality.