The "fini" pointer on array metadata was not being initialized
Extract the stack management code from parse.c to stack.c

For reuse during generation.