Without this when chat is disabled the API is not supercharged with these methods and it will cause an exception:
```
Uncaught (in promise) TypeError: t.decorateChatMessage is not a function
initialize discourse-math-mathjax.js:102
initialize discourse-math-mathjax.js:119
withPluginApi discourse-f7231bd5d10aa613b323a0cac71d8003baa74ef74f674fe4f91e4857994e661b.br.js:4735
initialize discourse-math-mathjax.js:118
initialize discourse-f7231bd5d10aa613b323a0cac71d8003baa74ef74f674fe4f91e4857994e661b.br.js:67
runInstanceInitializers Ember
each dag-map.js:192
walk dag-map.js:121
each dag-map.js:66
topsort dag-map.js:72
Ember 4
invoke queue.ts:201
flush queue.ts:98
flush deferred-action-queues.ts:75
_end index.ts:616
_boundAutorunEnd index.ts:257
discourse-math-mathjax.js:102
```
This commit is also removing jquery code and simplifying code.
Note that discourse-math is currently causing jumpy-ness in topics or in chat as the resulting processed mathjax element has a different size than the initial text node.
Previously we would remove elements from the DOM, this caused Ember to
get extremely confused and blow up its rendering.
Instead only hide the element, do not remove it.
* FEATURE: Add KaTeX in-browser rendering support.
* Remove ttf fonts from KaTeX
* Update KaTeX to v0.10.1, fix paths to fonts.
Font loading was fixed by rebuilding KaTeX
and specifiying absolute paths to fonts in CSS:
Steps to build KaTeX:
1. `git clone https://github.com/KaTeX/KaTeX.git && cd KaTeX`
`git submodule update --init --recursive`
2. Change paths to fonts:
`sed -ri 's/@font-folder.+$/@font-folder:
"\/plugins\/discourse-math\/katex\/fonts";/'
submodules/katex-fonts/fonts.less`
3. Disable TTF fonts:
`export USE_TTF=false`
Alternatively, we could modify `.browserslistrc` to match what
Discourse supports
3. Build KaTeX
`yarn && yarn builld`
4. Copy `katex.min.js` and `katex.min.css` from `dist/` to
`discourse-math/public/katex/`
5. Update fonts, copy woff and woff2 files from
`submodules/katex-fonts/fonts`
* Minor copy edit to settings
Mark MathKJax only settings
* Add Mhchem extension for KaTeX.
It is already automatically loaded for MathJaX.