Fix html5 math/stem

See commit messages for details.
Oops, ignore that comment. GitHub is showing the diff in a misleading way. I see you have it right.