Extract the creation of TsdbQuery objects into a QueryBuilder

It's not a big problem if both are called, nothing will break but they aren't intended and it would be considered bad practice to call both of them. `#checkNotNull()` only validated the input parameter, not the rest of the state.