Introduce QueryBuilder class

This class will help simplify the code in contactsreader
to allow more flexibility in constructing queries for
performance reasons.

This commit just introduces the class and its tests,
it does not take it into use yet.
start switching over to QueryBuilder

Use QueryBuilder for constructing the temporary
contact ids table, but in this commit only at
a surface level: leave buildWhere alone for now.