Undo and redo implemented as stacks. MacroRecorder class is used for recording macro commands