Actually this was pretty easy, just moved the ensureTableExists() call back to the tools and used the tsdb.getClient() call to fetch a reference. This will be deprecated by the data abstraction layer later on anyway.