I'll start by saying that I have not read the books, so I'm not trying to spoil anything - just my observations. I re-watched last night's episode over lunch today and here's what I noticed prior to Joffrey's death. When he poured the wine onto Tyrion, he wiped the inside of the cup with his finger and licked it, so that means if it was the wine that killed him it had to have been put in after Tyrion re-filled the cup. 2nd, when Margery announced the pie had arrived, Joffrey turns towards her and takes a quick drink before handing the cup to her. After he handed it to her, she sat it down near Grandma Tyrell (forgot her name). So my super-sleuthing skills lead me to believe old lady Tyrell did it.
I think it was Granny Tyrell too.