Adds hashing of thread_id in threads table.

This breaks message getting, but is a step in the right direction.