All files checked with jshint, many "beauty" improvements plus. Some assignments to global scope and other minor errors fixed