Niger is heading to the polls Sunday to elect a president after a campaign marked by tensions between rival parties in a country known for its poverty and the looming threat of extremism.