Fixes COMETD-462 (Support different server URLs for different transports).
Code cleanups.