Feature/timelines aggregations performance

See commits.