Added advertise and publish functions and basic usage example

Hi, here is the basic implementation of advertise and publish function, I tested the basic example and everything work fine to me. 
As also suggested on the example, it would be great to make all messages implement an interface with the "toJsonObject()" method to avoid building the JSon manually. 
I'm quite busy at the moment, but I think i'll do that in a near future.

As you will notice I changed the build.xml file to compile with ant because I'm on OSX

Cheers
Gabriele