Add more helper functions and change the stderr output

These functions are more useful to me, now that I
have zeroed in on a strategy for encoding messages.