fixes #16

Moved all applyedits into editor.js
Adding to UndoManager is now in success callback