US stocks open higher as S&P 500, Nasdaq both hit records