Made ThreadService maintain the messages model.