Reorder clauses for efficiency
[squash] Forgot the export
Support chainable contractions

Again, the goal is to feed the list of previous operations into the
global balancing optimizer.