make msg.cpp functions tolerate multi-frame messages. Refactor pub/sub code in the various engine classes. Start writing better tests of worker_engine