Former president Donald Trump has won the White House and Republicans have taken control of the Senate.