Implemented contract net protocol

Introduced some changes to the mail box as well, removing all messages
when the mail is retrieved.