Added listener and methods for undo/redo. Currently there is a bug with
them that causes a fatal error.