Reimplement CSV encoding of log messages.
Add IDM parser and flag for selecting message type.