further refactor codegen
further refactor codegen

Not sure if this is the best time to do this. There are at least two
more features that need to be implemented before I'll be comfortable
doing serious refactoring: same-ident-reassigning and pipelining.
Since I don't know what the implications of these are for codegen,
I'm reluctant to reduce things any further.

My guess, though, it that I'll want to define a new struct that holds
all codegen-related info for a given function or method. Then I can
keep the templates and rewrite rules grouped in one logical place,
instead of spread out across multiple consts and functions.

lukechampine/ply