Fix 'make stage0-interp-test'
Clarify the semantics of a begin body ending in a define
Clean up generation of top-level variables
Reorganize codegen-sections

The codegen-sections walker was being used for two distinct purposes:
First, making various late-stage simplifications to facilitate code
generation.  Second, sequencing the generation of code for each function
in turn (although lambdas may be nested, the code generated for them
is not, so code generation cannot be implemented by a single walker
over the whole program)

Here we separate the two things out.  First, the simplifications
previously done under codegen-sections move to a new codegen-simplify
phase.  Second, rather than using a walker to sequence code generation,
we introduce a 'todo' field in the codegen struct.  This is a list of
lambdas that are awaiting code generation.  Full-program code generation
becomes a depth-first traversal of the tree of lambdas via this 'todo'
list.

codegen-simplify is different from other compiler phases in that it
only operates over a single function body, and is invoked immediately
before codegen for the function.  This is because the fill-closures
phase has moved lambda bodies onto the 'body attribute.  But operating
immediately before codegen of the function might also give better locality,
and it might be worthwhile to restructure other compiler phases to work
in this way.