Added testWhileIdle etc.

Fixes gh-463