remove unused imports

also fixes a minor bug in mathjax machinery