Bugfix: correctly backs off reconnection, with upper limit

An error in logic meant that reconnection never backed off. This is now fixed, but back off should have an upper limit so that the interval between connection attempts never exceeds a reasonable maximum.

This update also fixes the browser test runner, which is the only environment that can test failed connections.