Cm configurable

Start refactor to make codemirror configurable.