A mesoscale theory of plasticity and cell structures