Added a workaround for setTimeout phantomjs bug

It fixes #59. See also https://github.com/ariya/phantomjs/issues/10832

This is a critical issue, since `waitForDOM` depends on it. Please note that `phantomjs` does not support `MutationObserver` API.