Replace direct curl usage by http fetch implementation

Most of this is kahrls work I just rebased and replaced occurences of curl within minetest