Editor must be focused before allowing certain keyboard shortcuts.

closes #4253
- checked for the CodeMirror-focused class on the CodeMirror div
- used length to determine whether CodeMirror-focused has been added
- determines whether the editor has been focused on
Merge pull request #4375 from DaveRobson/#4253

Editor must be focused before allowing certain keyboard shortcuts.