Uses https module

- Checks the download host, and if necessary uses the 'https' module
rather than the 'http' module.
- Uses piping to a writable stream.