Factorize openlayers/jquery/codemirror