Code Cleanup (Eclipse Validator)

Made changes to fix errors shown in Eclipse's JS validator (mostly
missing semicolons and missing "var" declaration in For loop iterators.)