Move rir payload format below header

and move its pack function to it