Steal codegenerator from marvin.
Code generator cleanup. No functional changes yet.
refactoring code generator
checkpoint/work in progress on code generator