Multiple clients handling rewritten. Using select on one thread instead of pthreads.