V1.1: Add undo, redo and recording functions.