Add publish procedure and loosen types of strings

It's quite handy to pass, e.g., `"/foo"` as a topic. I've made the
serialiser accept iolists for various string types, and (in some
places) to serialise to an iolist rather than making a big binary. Of
course, this requires that the roundtrip test canonicalise its input
to be able to compare it to the result; hence `binarise`.

Another subtlety that crops up in the roundtrip test is that default
values in records mean you have to explicitly set those fields when
parsing. To avoid that for optional strings, I've gone back to them
being undefined by default.

QoS levels `at_least_once` and `exactly_once` necessitate a message_id
serial number, so this has to come from the state.