On spells, here's all the data I've got. Anyone else can feel free to add in anything I might have missed.
First off, Page 180 of the PHB states what the four types of abilities are... Sp, Su, Ex, and Na. Na explicitly states that any ability that's not one of the first three is natural, so it's impossible for any ability to not be one of the four ability types. Both Sp and Su abilities are described by how they are different from being spells, making it clear that spellcasting is neither Sp nor Su. Since Shapechange and Polymorph both grant Natural and Extraordinary Special Attacks and spells are a Special Attack (they're always listed that way), those spells must grant spellcasting if the creature has it.
As to whether spells are Ex or Na, the entries in MMV are the only ones to define them, and they say Ex. Note that well spells themselves are obviously magical, the ability to cast spells might not be (otherwise spells like Invoke Magic wouldn't work because you wouldn't have spellcasting at all when you entered an antimagic field), so the fact that Ex abilities state they're not magical seems to be okay. If it weren't for the MMV entries I would have said spells are Natural, but then again Natural abilities are things innate to a creature and spellcasting can be either innate or learned (as in the case of class levels granting spells). Also, for balance reasons it's best if spells are Ex and not Natural, since Alter Self grants Natural abilities (at least according to the rules of the game article on the subject). So, I guess it's better that Alter Self doesn't do it. But either way, Polymorph and its big brother definitely grant spells.
Note that by no means am I saying they should grant spells. It's pretty freaking broken. Of course, you can always do as I do in games I run and just hack out the entire Polymorph line. That solves the problem nicely. But by RAW, they do grant spellcasting, so Shapechanging into a Solar gives you 20th level Cleric casting and Shapechanging into a Black Etherguant gives you 17th level Wizard casting. You still have to memorize spells of course once you assume those forms, but Shapechange can be made to last long enough for that to work especially if Extended (or, horrifically, Persisted).
JaronK