simplify query building logic

as a side-effect we now have fakeldap with support for '&' queries with
a single filter(e.g. "(&(myfilter=true))" )

Change-Id: I29564704f58e108cbfb488c18e1dfd4656e1d18c
Merge "simplify query building logic"