Mathjax improvements

- Switch to %% for inline math
- Fix <em> insertion for _
- Fix math regexp bug