Replace calls to send with explicit writes

Connect doesn’t have `.send()`
Signal failure to login
Clean up origin calculation

- Allow fixed (configurable) origin as an alternative to dynamic origin
- Avoid relying on Express specifics like req.protocol, req.get and req.path
Merge pull request #1 from pdpi/connect

Restore connect support