Rewrite waitForText to use a more intelligent sleep pattern.
Merge commit 'd384070e286a973823c3b9b552c93b3c05d78808' into develop