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.

Fixes #708
Fixes #717