Add support for groupby in statistics for API v2

Adds the groupby parameter to list method of Statistics
and a new option "-g/--groupby" for the shell.

Change-Id: I41cfa076bf73f8c01d4ee71cd70008ea231556c8
Closes-Bug: #1270094
Merge "Add support for groupby in statistics for API v2"