Implemented almost all undos, untested.