Two goals from Wayne Rooney, including a wonder strike from just inside the West Ham half, secured Manchester United a 2-0 victory at Upton Park.