Add persistent undo support.