drastically new version based on CodeMirror