undo/redo

- working undo/redo for move
- working undo/redo for delete
- various bug fixes