[WIP] [DO NOT MERGE] make group reading and user counting faster

Needs more work, but so far my case was get all groups (still happens in too many places) with a lot of LDAP groups (7005) next to other groups plus user counting with search string. Here I went down from terrible 170s to 23s.

TODOs left: 
[ ] benchmark with  AD (so far only OpenLDAP tested)
[ ] benchmark without cache (no cache vs file cache)
[ ] benchmark with other test cases (esp. with Limit)
[ ] benchmark with smaller number of groups
[ ] tests for group/database
[ ] tests for access?
[ ] tests for  group_ldap?
[ ] doc: highly recommend memcache (other pull request)