Statistics rework

This reworks the statistics endpoints entirely. See the API documentation for the new endpoints. The calls are less expensive but we should still run them in a scheduled context - with a separate table we can cheaply query for results.