CURL-related fixes and more

A bunch of CURL-related fixes, small optimizations and some CStdString removal
@jmarshallnz ?
We never made a difference between types targets here before. Why now?