Right, here is how I understand it. (btw skip to bottom if wall of text seems to much)
Long Version, in detail for those who disagree or are interested
First Izanagi:
Uchiha could very easily have gotten Senju DNA, be it by forcefully breading to make hybrids, or by getting DNA during battle, Senju DNA would both extend the use of Izanagi and enable it's use.
As for the eyes, it would not be the first time we have heard of Uchiha stealing the eyes of their comrades for the preservation of their power, this may very well have been the main reason behind the development of Izanami to stop those who grew arrogant and prideful who resulted to pillaging their weaker clan mates and stealing their eyes.
Now the Edo Tensei and Izanagi: Not sure if Kabuto will end it but he probably will, Izanagi from how I'm seeing it is one of the most tactically useful kinjutsu and Genjutsu in the ninja world, it traps the enemy in an infinite loop as long as the enemy pursues his/her objective, it is a destiny deciding justu for this reason.
It can be used on sasuke until he no longer wishes to crush konoah or if itachi is a strong enough genjutsu user it could be used on madara and his objective to kill the five kages.
Could this skill be adapted so that the person is stuck in a loop as long as they pursue the victory of a battle, it is an auto-win jutsu, it keeps the user in an illusion until they give up an objective or at-least change the path, which is crucial if used correctly.
Will Madara live: Despite the fact that he did not deny the fact that he developed the rinnegan during his fight with the first, he was utterly batter during that fight, he had a massive blade through his back by the end of it, with agony on his face, it was over but if the end and been delayed 5 minutes he could have made use of his new powerful eyes and turned the fight over.
Madara has been restored now, and with his eyes, this is why he is better than he was at is prime, he can sustain himself without the Edo and even if he can't he will have a double immortality, from his eyes and from the Edo ending, because if the Edo ends from Kabuto, then Muu dies, putting Madara in a state of immortality, the only way is to seal him at that stage, or rip his soul out.
The only person capable of killing Madara is the only person capable of killing the first, the Third, ah but he is dead too, so I guess we will see.
Short version.
Izanagi can be obtained from Hybrids Uchiha-Senju or from the battle field. It could have even been given willingly during the alliance, eyes could have easily been stolen by powerful Uchiha, or given willingly by dying comrades.
Izanami can change the course of any battle by changing the objective of the opponent.
Madara will be Immortal if kabuto ends the Edo if the Edo ends from Kabuto, then Muu dies, putting Madara in a state of immortality.
Using both Izanagi and Izanami would but OP, even at madaras level.