Refactored js code and merged to the master

Uppercase is typically reserved for constants.
https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml#Naming
"Private properties and methods should be named with a trailing underscore"