Extract the creation of TsdbQuery objects into a QueryBuilder

Here we should check that everything that is mandatory is present, aggregator and tags