Improve unit tests and add jshint check