fixed bugs with undo and redo

- appropriate shadows
- replaceNode is fixed
- changed how insertLine works