refs #408 - added support for PhantomJS onCallback (window.callPhantom)