Tests should be done for TSDB class.

If `max_id` is only an incremented integer won't it be more CPU efficient to store it as a field on the `MemoryStore` instead of looking it up in a potentially in this context relatively big list every time?