Added app trending calculations (bugs 911275, 911280)

This adds a table to store trending and per-region trending and a cron
to update this trending table.