Upstream

(Hopefully this is a clean pull request now!)

This changes all (that I've found) examples of `a^\mathsth{b}` to `a^{\mathsth{b}}` (where `\mathsth` is one of the math font commands such as `\mathsf`).  This makes no difference to the typeset output, but means that `^` can be redefined to be a macro, which the ePub conversion class does.