Refactor downloads

https://github.com/cnpm/cnpmjs.org/wiki/Migrating-from-1.x-to-2.x

Use downloads table instead of download_total

Fixes #544
fixed