Simplify test_phantom.js
Work around phantomjs+setTimeout bug