Legumes, a crop of poor and small farmers, have got a lending hand from scientists.