Converting Leathrum's mathjaxapp to PhoneGap