Added Herd and Veg classes, moved most standalone functions into methods of those classes.