WASHINGTON — Barack Obama won the presidency by exploiting a political environment that devoured George W. Bush in a second term plagued by sinking credibility, failed legislative battles, fractured world relations and revolts inside his own party.