caching jquery elements and jshint fixes