Backport of #9225

fix in displayNamesInGroup: when specified limit N, we did complex search only in the first N users

change logic in displayNamesInGroup and add some unit tests

add more logic in displayNamesInGroup for big user bases

1. remove sizeof($filteredUsers) > 0 as condition
2. use count instead of sizeof. Latter is an alias to first one, practically we stick to count everywhere. Having it consistent helps with readability.
3. move whitespace so we have $groupUsers[] = $filteredUser; instead of $groupUsers []= $filteredUser;

Conflicts:
	tests/lib/group/manager.php
remove duplicate call to groupExists
Fix test cases for group manager
cache the result from inGroup
user Group->users as assosiative array
remove unneeded ; in comment
add optional countUsersInGroup method to group backends

Conflicts:
	lib/private/group/backend.php
	lib/private/group/database.php
	lib/private/group/dummy.php
Fix getting group '0' from database backend

Fix #9972
ask implementsAction instead of checking method_exists for easier testing
Fix in stable6 after backport of #9225
Merge branch 'voxsim-backport-9225-stable6' into backport-9225-stable6
Merge pull request #11217 from owncloud/backport-9225-stable6

Backport of #9225 to stable6