Wall Street closed out a wild year of trading with two major stock indexes hitting fresh record highs.