Brady's 517 yards, 4 TDs lift Pats over Dolphins