Pkgdb2 changes

For pkgdb2 we are working on allowing groups to have commit ACLs, for this we create a new type of group the
'pkgdb' groups and we need a way to retrieve all the groups of a certain type (pkgdb type for pkgdb2).

These commits implement both.