Nasdaq breaks out, S&P 500 nears major technical test