Create data model for metrics and their views, add reduce functions