allow custom function for phantom stdout and stderr

I saw the other pull request with no movement, so I thought I'd make my own.

I need this to save off the errors instead of printing them to the console.

Please publish this version on npm when you're able to merge.

Thanks!