Added support for CodeMirror 3.1, fixes #2