Added support for curl as alternative for wget

Added support for using curl, to enable by specifying "-c" on the command line.
Only roughly tested.