Fix for Elizabeth's bug (certain equivalent forms not being accepted).

The issue is that factoring out a common factor was happening before
equations (in expression form) got collected. This means that some
equivalent forms of an expression had their common factors factored
out, and others didn't.

Test Plan:
src/expressiontools/test.html

Auditors: alpert