added local path checking for mathJaxPath, fallback to CDN if missing