Abstract the testing pb client to a test module

Here we can set the protocol buffer client port to be an env var PB_PORT
Fix connection tests

Some of the http-cliet/connection tests need to talk directly to the
lib/http-client.js object.