Added .jshintignore to ignore "duplicated" code in dist folder.

Removed some duplicated code.

Fixed some jslint issues.