Stocks could ride a tailwind into 2018, bolstered by the best annual gains in four years and the promise of a generous earnings boost from tax cuts.