new fixes and dependencies
added scripts.test to package.json so travis executes tests
close also if socket.readyState is on "opening"