Added t-chat-threads directive, moved thread data to the ThreadService.

- Other minor fixes.