Message ids

Tried to fix the cid: problem + provide safer id generation
Since #557 was merged, we do not need this change any more I guess,