Implemented thread tracking via memcached, various caching fixes