Extract the creation of TsdbQuery objects into a QueryBuilder

The functionality around that hasn't changed so the exception will bubble up and will probably finally be caught by netty which will cause an error to be returned to the user.