Mathjax loading refactored so config works

This fixes LaTeX math.