Use PhantomJS without having to write so many callback functions.