Activity: Introduce new class - `BP_Activity_Query`.

`BP_Activity_Query` is a helper class, which extends the
`BP_Recursive_Query` class, for generating complex queries against data in
the activity database table.

A `'filter_query'` argument has been introduced to the `bp_has_activities()`
stack to support the use of `BP_Activity_Query` across the majority of
activity fetching functions.

See #4988.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@9256 cdf35c40-ae34-48e0-9cc9-0c9da1808c22