Added Publishing capabilities outside of files

This can be used to publish message bodies along with their properties.
Refactored to remove duplication.

Signed-off-by: Jesse Szwedko <j.szwedko@modcloth.com>