munge rows into keyed lists