fixes #84

Adding custom transports via transport factories.
Ah, handy! What's missing: copyright header. Alternative: move the function to `util.js` .. actually I'd prefer that, since it's just a single utility function ..