Extract the creation of TsdbQuery objects into a QueryBuilder

Why isn't this needed anymore?