Added "mobile: waitForPageLoad" that will gather up all the indicators and wait for them to either be destroyed or is no longer visible.

Added mainWindow to the global list, and changed a few lines to make jshlint happy.