Added a shutdown hook so that when the TSDB is shutdown it flushes the cached data to the data store.
timer thread was only running once. Now it runs every minute.
The maps hashcode have collisions on similar sets. To alleviate this issue toString is used instead.