Add some PhantomJS support functions.