Fix sending of commands and chat messages
Add --with-logging option (-DVERBOSE now disabled by default)