Move more helpers into ESX.hs.

These will be needed for conversion of other record types.