Changes external CDNs to HTTPS if possible.

Trying to load http resources from a https page will be blocked by browers (e.g
Chrome).

The cdn.mathjax.org have some problem with their certification so I didn't
change this one.