Implemented new ready checking in JSDom and Phantom