Tidy up amqp connection handling a bit
Add some documentation