Miguel/plugin refactor

Technically, the error message thrown here isn't completely correct: we don't check for CodeMirror being valid, just for it being falsy. Also, we might want to add the received CodeMirror var, but I'm not too sure about both of these.