Core: Introduce new class - `BP_Recursive_Query`.

`BP_Recursive_Query` is a new abstract class based off of work done in
WordPress 4.1 to support the creation of advanced SQL clauses (nested
clauses and multiple operators).  See:
https://core.trac.wordpress.org/ticket/29642#comment:6

The `BP_XProfile_Query` class already uses a version of this class.  The
goal is for `BP_XProfile_Query` to extend `BP_Recursive_Query` in a future
commit (see https://buddypress.trac.wordpress.org/ticket/5839#comment:9).
Also, the activity component will be the next to use the class to support
advanced filtering (#4988).

Props boonebgorges.

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