Added AMQP support and refactored the handlers just a little.