Remove dead generated code, prepare shell scripts for submission
Small codegen optimizations

Don't put global variables or constants onto the stack