Move more code into event handler
Move backspace cancel to gui.js