Rework of stats store and endpoints

This pull request:

* Introduces separate tables for aggregate and historical metrics
* reworks the statistics endpoints (`/api/stats/*`) to make use of the new tables
* changes the primary key of the Tasks table to `challenge_slug` + `identifier`
* adds a 5000 task limit to the bulk task update API endpoint

As well as some minor improvements:

* Add an option in the Fabric script to upgrade the requirements
* Clean up the configuration file template
* Add CORS allowed origin to the config file
* Adapt manager script to work with the new task model