Moved stuff to ct.client.db, applied comments.