Big refactoring for the Messaging

The messaging has now real business interfaces.
The agent's code is a little bit better.
Unit tests have been added on the messaging, the DM and the REST client.

This pull request also solves some issues.
#37 Find the Rabbit MQ port
#50 Error on Application Upload
#64 Sort instance paths in the REST implementation