Enable download stat getting from Piwik.
Make tests optional.
Split getting views and downloads to separate methods.
Extract download figures and add to total.
Add debug output to check calls to API.
Ignore cases where data is meet expected patterns.
Use a generic method to get views. Make downloads use it.
Capture json decode errors.
Make engines that require multiple queries run.