Removes the DISTINCT from the COUNT query, there can never be multiple returns anyway
Removes the sub-query to improve speed
Loops through the groups if multiple
Merge branch 'WOBS-3298' of https://github.com/terwey/Newscoop

Conflicts:
	newscoop/library/Newscoop/Entity/Repository/UserRepository.php