Ported messages plugin to be a module

In addition, filled out the Java API to provide more than just static
methods.