Implement gethead/getraw by curl

curl is crap, but at least it has switches that make it possible to display headers and no other output...