Move TSDB backend into proper abstraction