cope with joins up to depth 3 on persons and organizations

Populates the person or organization memberships of a returned
item in a collection. Limited to depth 3 as it probably doesn't
make sense to go deeper.
allow collection query to be limited to basic information

i.e. skip the population of the memberships which significantly cuts
down the size of the returned data if that's all you want.