Improve support for CodeMirror: fix cut/copy/paste in context menu
Note: undo/redo currently works strange even in Scratchpad
(WIP for #17)