Code style cleanup; sanitization; MathML tags

* whitelisted MathML tags
* code style conforms to WordPress VIP standards
* sanitization of input and escaping of output