Refactored client to use persistent connections

and server to use zselect for handling concurrency