At no time in the Manga, it looked like Obito was Madara's friend, he never call Madara a Master or anything. Madara was able to influence and manipulate the situation so Obito could continue with the plans.
What Obito told Madara in the last chapter, should not be a surprise so don't try feelling like you figured something out with your little brain. What theory? You just pointed out the obvious, that's all. However, your observations might be news to those 10 years old or younger that are still in elementary school trying to learn "reading comprehension".
BTW: If so far Obito is alive is becasue Madara wants him to since he needs him. Madara can kill Obito any time. All he has to do is say the magic words and bang, he is dead.