Added history (undo/redo) support