Fixed #16979 -- Added support for nested Q objects

Nested Q objects can be used to factor out common prefixes from keyword arguments, e.g. Q(foo__a=1) | Q(foo__b=2) == Q(foo=Q(a=1) | Q(b=2)).