Ballot counting is underway in the battleground states of Michigan, Wisconsin and Pennsylvania, as a bitterly divided America heads to the polls for the general election.