persistent sockets client

Here's an initial stab at #236.

Please provide feedback.