Agriculture helped shaped dog evolution, study finds