Move more of codegen into individual functions.

Pending future refactor to create specific parsenodes for each of these.