Backport recent changes in trunk to the mathtex branch.
Update the mathtex branch so that it is up-to-date with trunk.
Creating a branch for mathtex integration.