Fix the LaTeX problems/HTML so high level source is saved.

Adds an integration test that verifies the bug fix.

Create helper method for typing in CodeMirror (which hopefully will now work on Mac as well).

@dmitchell Please try running the tests on your machine
@JonahStanley can you code review the tests? I do have two waits in the test, which I'd love to get rid of. I think I just need to figure out the right things to wait on.
@cdodge Can you code review the "hack" code that I restored in module_edit.coffee? This is code that was there previously, and it was how we saved all the metadata values. Now the only thing that will get picked up is source_code, as the other fields won't be marked with the class we are looking for.

@ichuang FYI, here is my pull request.