Improvements to CodeMirror usage