download: convert into a module and clean up

Change-Id: Ied0f7e3bd696b0fb35bf2d705b8e0dda62c51879
Merge "download: convert into a module and clean up" into production