Move the binding of editor events to new function

Should be called after every edit event
Add mousetrap
Fix editor bindings