Port to libcurl [IN PROGRESS]