Added syntax checking script
Added more syntax checking.
Fixed many bad global accesses, uncaught until the new syntax checking.