The Sinn Fein leader, who has died at 66, went from waging war to forging a partnership that helped end it.