Add a "waitForNotVisible" function.

It does exactly as described, it waits for an element to be not visible.