RE: Gandalf dying.
Having just reread the portion of TT where Gandalf describes that bit, I'm forced to conclude he didn't actually die, but was just horribly weakened. He never said he left or died or anything like that, merely that he lay there and could hear the groaning of stones and days were very very long. This suggests being beaten to a pulp, but still being alive, since he was actually hearing things. Last time I checked, dead people don't hear things.