Messaging - DAO changes

Adds two join tables for messages to threads and threads to objects.
Each message can belong to one thread and each thread can belong to one object.