WyC: slowly starting to simplify the code generator by pulling lots of stuff out.  This stuff will now be handled later on in the pipeline.