Thanks for the input. Got away from the project for a bit. Could'nt quite make your suggestion work, but I found something that is probably more appropriate.
It is mentioned here:
That one could just create those <script> tags and have MathJax do its thing as usual. It kinda works.
I would like to have my math rendered within <math> elements, but MathJax refuses to work with these. I guess someone thought that since it is reserved for MathML it should not be used. Maybe they are right, but I would like to turn this off and have the outermost element of the rendered math be a <math> element that I specify, but I can work around it so don't sweat it.
A much bigger problem is that for some reason MathJax will not create the <div class="MathJax_Display"></div> when I tell it to use mode="display" it still creates inline spans and nothing is centered. Any ideas as to why this is? This is of course not when using <math> elements as they produce nothing at all.
Many thanks for any input as I have been pulling my hair over this for a couple of hours now.