Primary producing groups in early and early medieval Kerala: production process and historical roots of transition to castes (300-1300 CE)