Fixed some accidental globals and a method typo.

trackNotificationSent had a typo on line 346 that prevented the success callback from firing.  Also, a couple of for loops didn't declare their i variables, causing a global i in the window namespace.
Merge pull request #3 from young-steveo/patch-1

Fixed some accidental globals and a method typo.