build AST/scope/error checking done

rewrote whereDeclared for the last time. Found out my for...in loop (to
iterate through an array) was returning lots of undefineds for unknown
reasons, which caused all the whereDeclared problems.
fixed some bugs, prints scopes

still have to do warnings