Obito's knowledge explained
Many of you are asking questions about Obito. Well one of them already has an answer.
How the hell did Obito know Madara and have all his knowledge?
Simple, he had been in contact with Zetsu. As you can see, his body has been fixed up by Zetsu (the look of his face, and the white goo that comes out when he gets hit).
Zetsu taught him all he needed to know about Madara's plan. Madara's assistant is Zetsu, he doesn't actually know Obito directly. It's Zetsu who was entrusted into finding someone suitable for continuing his plan.
The rest, we don't know yet. But that's one thing you can be 99% sure of.