start to handle client input

this is good enough to allow irc clients to connect (tested with irssi
and empathy)