first partial implementation of an undo system
repositions cursor correctly after undo
can now undo remove actions as well as inserts
refactoring: cleaner undo copy function
undo system can now handle multi-character inserts (paste)