adding promise support, and updating to pass jshint