Modified all instances of parseResponse to now have error handling.

- When an error occurs, instead of throwing ot the window object we now handle it appropriately.

#2506
Added tests to verify response redirection handling in addition to verifying parse responses is handled correctly when it throws.

- Also added the wrapStart functionality to the JS test utilities

#2506
Whenever we fail at parsing a response from the server we trigger the error handler and stop the connection.

#2506
Altered how the transports handled failed parsing cases.

- If transports fail to parse a response while in connecting they will now fall back.
- Centralized this logic in the common.js

#2506
Added a test to verify that transports that fail to parse responses while connecting indeed do fall back.

- Also fixed some long polling logic

#2506