Iraq's prime minister of eight years, Nouri al-Maliki, is stepping down and endorsing Haider al-Abadi as his successor.