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
Could you add a comment above this if along the lines of `// Only fire editor shortcuts when the editor has focus`.