cq_thread and cm_event_handler cleanup
More cleanup
Server/client main code cleanup