I know tobi is an alias used by both obito and Madara. The tobi that visited itachi was Madara. You can tell by the way his hair is way different from obito's hair has ever been. Also, I believe the tobi that control the mizukage was madara. I can't believe that tobi was obito under any circumstance. Anyway I believe that after Madara died obito took on the name of tobi, probably after madara train him for awhile n we have Tue story thus far.