Fixed .requiresMathJax() matching to code from the R syntax highligting script

Moved the .requiresMathJax() check before the inclusion of the "R syntax highlighter" script to avoid false positive pattern match to the highlighter code. Otherwise, when the highlighter script was included also  MathJax libraries were enabled regardless of whether math expressions were actually present in the document or not.