Use libcurl for POST requests and some style fixes