Removed some commented code and added .jshintrc
Refactored code