Connection cache for producer

Optionally globally cache connections to a host:port.

Connecting/reconnecting was broken into a separate Connection object. This is what is cached. Many Producers can share one Connection. The original event generation behavior was preserved.

The producer test runs twice, with and without caching. New tests were added with a mock socket to test edge cases.