For clarity, this moves the formatting functionality related to formulas and terms into two separate files.