should not increase external dependence

* use open-uri instead of calling curl.
* use binary mode to write binary file.