Move variable renaming later in compilation.

Moves variable renaming to the code generation phase.

This fixes all bugs in depriming in type errors, and also makes the parser more modular.