Take that, cats: new study shows dogs understand human emotions