Stock market today: Dow closes above 40,000 as rally breaks out beyond mega-cap tech