Plain refactoring
Undo and redo on Ctrl+Z and Shift+Ctrl+Z (yes I also thought that should run on Ctrl+Y, but...)
Some bugfixes