Replaced static TransportFactory with a version that allows users to add their own Transports. Other misc cleanup.