Added code generation phase.

Code generation will add functions and a main label.
Function stacks/activation records are set up correctly (I think).