Minor refactor & tidy of undo.js
Undo via Command+Z/Y keys