Uses curl wrapper, getters and setters for properties

Use curl wrapper instead of native curl_* functions.
Make properties protected. Control its state via getters and setters.