Add mathjax config only to the math `script`s.
Add the mathjax script only to the head.

Adding it to $('script') is fragile and might add the script tag in multiple
places.