Copy codemirror mode configuration instead of changing it

If we change it, the modified (wrong) mode is saved in the notebook, which
wrecks havoc on highlighting once the notebook is saved and reopened.
Merge pull request #6253 from jasongrout/highlighting-bug

Copy codemirror mode configuration instead of changing it