Stocks rallied as investors digested Donald Trump's victory in the US presidential election over Kamala Harris.