Try not to pollute the other XWiki actions with CodeMirror specific code
Reviewd the way CodeMirror instances are initialized, specifically in the object editor case.