Use Closure Compiler checkVars flag

This commit uses --jscomp_error=checkVars on the compiler.jar command line. This is to be able to detect undeclared variables. To prevent the compiler to give error for the global "ol", "$" and "angular" variables, externs are used.

Please review and merge if you think this is useful.