Message ids

Tried to fix the cid: problem + provide safer id generation
it might even be a trait from my point of view, it's more of an utility function, but, can be private to avoid use by subclasses, not sure on the best practice here