Changed 0MQ protocol; made output more useful; added tests.