Added comment
Fetch all inherited flags in a single column

Optimisation of contact_make_query_with_fields, now fetches
bit_or(flags) group by contact_id.
http://www.postgresql.org/docs/current/static/functions-aggregate.html