Republicans have won control of the Senate after flipping several Democrat-held seats red in critical states.