Update mathjax.py

Update logic for calculating Typogrify version testing
Updated typogrify ignore logic, and using 'math' for class to wrap mathjax
Separated inline and displayed math logic
Making plugin compatible with rst