Madara when at fist He thought Tobi had use Nagato to bring Him back to life, and not Kabuto and Edo. It's obvious Tobi worked for Madara, took over His plan after He died and change it to suit His purpose and not Madara's plan a Blind Man could see it coming.Where does it say that Madara was the master of Tobi?
People, stop with the baseless assumptions already!!