adding jshint

fixed several jshint errors and warnings
merged