Reveal and fix nested scope bug, and give each frame a stack

There were two problems with generators: first, inner functions could modify the scopes of outer functions, which caused the internal magic-name ".0" for generator 2 to clobber generator 1. Second, each frame needs its own stack for switching back and forth between scopes.