CodeMirror Refactor & Upgrade

This is step 1 of a refactor towards fixing: #2385, #2108

These issues require that CodeMirror be upgraded to a version with a different API & that the code be much more modular so that we can swap out CodeMirror for a standard TextArea for mobile.

At the same time this refactor is improving our CodeClimate score: https://codeclimate.com/github/ErisDS/Ghost/compare/cm-refactor
aaand, I think it will make reimplementing the editor in Ember.js easier.

It is a [WIP] and is not intended to be merged yet.

Still to come:

- better, more consistent structuring of each module
- lots of commenting to help decipher the code
- swap `setLine` and `removeLine` for `replacerange` anywhere they appear