Add a rebalance optimization phase

There's a number of rebalancing steps that are completely independent
(the different binary ops can't effect each other).  This brings up a
good example of when we should have many passes in a phase, as the
output of this phase is completely independent of the optimization
passes.