Support for CodeMirror UI loading via CommonJS or AMD (RequireJS).

This is necessary for more recent versions of CodeMirror, when they are
loaded via RequireJS, because they don't expose CodeMirror to the global namespace.