communications overhaul

Fixes the surprisingly unnoticed bug where you can only receive data
from the client that is currently selected. Also fixes disconnect and
client selection issues.