Beautified code, ran through jslint and corrected code to latest JS s… …
…tandards