Installed requireJS and configured it to load all js libraries as before.
Added bootstrap as a dependency of jquery-ui so it is loaded correctly!
Detect content-type of file and load specified CodeMirror mode when opening.

re-enabled page protection on index.php (committed by accident)
Merge pull request #2 from stomppah/master

Detect language of opened file, and include JS modes for CodeMirror as required