Optimize for loops

For loops now only re-create a scope each iteration if there's a
function definition inside to take advantage of it.
Remove run_test

This shell script is no longer needed now we have compiler.deja.