Conform code to Google JavaScript standards

Provided general clean up to the source with the goal of making it more
readable and also to align its style with Google's JavaScript Style
Guide which will be used by the project going forward. Through the
process a number of inefficiencies were eliminated in the code.

See also:
http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml