Adjust times so that the second pass doesn't take so long (we may need to tweak these further).
Make HTML-CSS measure the final math element so that the right amount of place is left for it (particularly a problem in Safari).