Added jshint, fixed some warnings/errors.