Cse rewrite

A rewrite of common-subexpression-elimination. The old version was pretty flaky.
The visit methods are only called by compare_expr or compare_stmt, which only enter the visit methods when result == Equal. I did this to save the redundant early-out in all the visit methods.