Cse rewrite

A rewrite of common-subexpression-elimination. The old version was pretty flaky.
It might be worth making a 'compare_exprs' that compares vectors of Exprs. Call, Provide, Allocate, etc. all compare vectors of exprs, it's a fair bit of redundant logic that could nicely be moved into a function.