Minor refactoring of the HTTP transport and wrote the TCP transport and tests.