remove dynamic code generation, gain useful stacks

significantly simplifies the code by tossing out the broken code
generation and replacing it with a few lines of copypasta.