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().