Support cURL if it's enabled

I know that there's a reluctance for cURL support as it will make it a direct dependency and the idea is to avoid that.

However, this has been added in a way that simply makes it an enhancement if it's available, rather than a hard dependency.

This adds some flexibility to the library and adds some support for a pretty common php module that I think would be worthwhile

cc @willmorgan