Keith Earls is the beneficiary of a great tackle as Ireland beat Wales to move to second in the World Rankings.