Rewrite renderMath() to also parse inline math
Rewrite insertMath() to know when to apply inline vs block formating
Rewrite renderMath() function

Rewrites the renderMath() function to sanatize, render math, and render markdown.

Big thanks to @tilgovi for help here.
Fix regular expression and add MathJax fallback

The regular expression was incorrect and was matching the occurance of any backslash, but this commit fixes it as well as reintroduces the MathJax fallback.
Merge renderMath() into ctrl.$render add basic inline math support

Since renderMath() is doing much more than just rendering math, it is now a part of ctrl.$render(). This commit also adds basic support for inline math. However, this is not quite ready, using inline math inside of lists or block quotes does not yet work.
Add support for additional \\( block math \\)

Clean up code, add comments, and add CSS to hide MathJax rendered math in a collapsed annotation.
Add explanatory comments.
Fix #1573, make annotation bodies collapse correctly
Remove 'or MathML' from the text inserted on pressing the Math markdown button.
Undo fix for #1573.
Create renderInlineMath() to handle edge cases

Splits up math and markdown rendering into 2 functions:

renderMathAndMarkdown handles blockmath, and renderInlineMath handles inline math. Multiline math like matrices is not supported with inline math, but this is ok because it wouldn't look right anyway.
Clean up code. Implemenet @tilgovi's suggestions.

Add a third argument to the applyInlineMarkup() to handle inline math markup which uses both \\( and \\).

Delete the now unnecessary inlineMath() function, applyInlineMarkup() is now used instead.

Simplify scope.insertMath().
Handle edge case in scope.insertMath() rather than applyInlineMarkup()
Merge pull request #1558 from hypothesis/math-support

Improve math support for matrices, inline content and list item and block quotes containing math.