reengineered waitForData
jshint issues
Sort Travis build error