Change compileToComplexFunction to generate much nicer code, by including an explicit lowering operation and a few optimizations.
Un-fuse the construction of values and the computation of useCounts. It can be done as a separate pass over the instructions, and the code looks a bit more functional this way.
Fix use counts.
Add constant-folding to compileToComplexFunction.
Fix awful bug in constant folding.
More comments for compileToComplexFunction.