Added travis CI and fixed some problems caught by jshint