Extract the creation of TsdbQuery objects into a QueryBuilder

Same here, duplicates?