unit tests + jshint fixes