Add the download function.

However this download function may not be enough, because it needs to
check depends recursively until all depends are fulfilled.