use $.map for setting cm options
redirect /edit/ to /files/ if not (utf8) text
s/mode/language/

for user-facing CodeMirror mode (hover text, language menu)