Stocks close out their best year since 2013; S&P 500 index gains 28.9%, led by huge gains in technology companies