Code Cleanup (Eclipse validator)

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