Refactor how we calculate intervals
The way we evaluate intervals currently in metrics website, is split between the java code and the database.
We should refactor how these are calculated so that these calculations are performed all in one place. This will also improve readability of the code and will help us spot possible bugs while we migrate to postgres + VictoriaMetrics.
Distantly related w/ #16 (closed)