Cherry picked updates from upstream to 2014-10-14 commits.

Needed to leave:
- generateQueueName() => uuid
- on close events for disconnections