getHtmlFromRange should use CodeMirror's version of truth

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

also add a spec for this