Add message writing to hdf5 format