Add option for connect timeout

This adds a new option `connectTimeout` which specifies a timeout (in milliseconds) for the initial connection to timeout. This applies to the time between sending data to the remote server and establishing a TCP connection. The default value is to not have a timeout, which makes it backwards-compatible.

This timeout is named `connectTimeout` because it specifically ONLY applies to the connection establishment, nothing else. This means that the timeout will no longer time out any operation after the connection has been successfully established.

Fixes #708
Fixes #717