The next leader will be taking charge of a country that has evolved remarkably in recent years, but his success will depend on healing the wounds of factionalism and lawlessness