Load `CodeMirror` as a module

Because `window.CodeMirror` is deprecated.
Fix JSLint warnings about not using strict equality
Fix JSLint warning about missing space
Fix JSLint warnings about using functions before they were defined
Merge pull request #3 from sbruchmann/sbruchmann/refactor

Refactor main.js