move javascripts to bottom of the body tag
update writemaths; \var and \simplify are MathJax extensions

writemaths should be faster, and is throttled so repeated keypresses won't lock up the browser.
\var and \simplify are now implemented as macros in MathJax, so I don't have to do a load of parsing of TeX before passing it on to MathJax. This should be a bit faster but, more importantly, less prone to weird syntax things.