Extract the creation of TsdbQuery objects into a QueryBuilder

I would like to have a longer comment here describing the differences regarding if tsuids is null or have been set