Fix loading of mathjax

Closes #80 

I switched around the script tags so configuration options are set before the loading of the mathjax script. This is the documented way to load it, so maybe that should stop it from sometimes not working. 

After switching it I have not been able to reproduce the bug anymore, but please test it before merging.