DRY up some editor functions.
Restore view on view mode
Use keypress event instead of keyup.