Updates working toward a complete chat server

Better packet management
query failures returned as part of a query result
mutex locking for Khaan
Simplification of the logging funcionality