Added delay parameter to wait_for function

Added delay parameter to wait_for function
Added wait_for test
Merge pull request #216 from psav/enhance_wait_for

Added delay parameter to wait_for function