Semi-working undo/redo. The redo need some thinking. The arrays need to
be emptyed if the undo is used after the redo.