New test helper for creating messages

This replaces all the various `mkmsg_*()` functions and methods scattered about the place.

The first commit contains the helper itself and the rest are just huge piles of changes from the old thing to the new thing. I haven't done the transport tests yet so there's a possibility that the helper will have to change to accommodate strange things we do in those, but I don't think that's very likely.