Added undo/redo infrastructure