Make most chat functions private.

The chat client and server don't need to expose any functionality other
than creation.
Break from outter loop instead of inner select.