Rename count > _count, pull nested_merge to module

@robyoung
@gtrogers
Factor nested merge into two methods
Change _count to count total docs,add _group_count

@robyoung
@gtrogers
Merge pull request #14 from alphagov/improve_grouping_functionality

Improve grouping functionality