Stub DB call for the message threads and small cleanups.

Just a few changes I thought were fitting while navigating *TSEncryptedDatabase* for the first time.
This cleans up a few files and adds a SQLite stub query for the message threads which returns all message threads correctly, containing the latest message, but missing the conversation participants.

```SELECT *,MAX(m.timestamp) FROM messages m GROUP BY thread_id ORDER BY timestamp DESC;```