Make possible to set the desired timeout for cURL connection

Sorry for the individual commits, I used the GitHub online editor to easily make the needed changes.