GPII-1014: Jshinted, added comments and a couple of fixes.