add groupBy, indexBy, countBy and shuffle functions and tests