Fix race condition with stubbing modal dialogs.
Merge pull request #41 from edx/will/better-alerts

Fix race condition with stubbing modal dialogs.