getHtmlFromRange should use CodeMirror's version of truth

resolves https://github.com/firebase/firepad/issues/117
resolves https://github.com/firebase/firepad/issues/85

also add a spec for this