Updated the JS web sockets code to use an exponential back off algorithm