Cleanup of lowering code.

The main achievement is that the once extremely verbose patterns for
inserting lowered code now look much closer to assembly code.