Implemented undo/redo (still unbounded, which is not that great)