Two-way communication for PhantomJS and Node