mathjax and pygments integration, modularised a few pieces