Upgraded mocha-phantomjs code

I was experiencing issues with the dot reporter and such where there would be extra newlines in the reporter output.  Upgrading the code from phantomjs in lib fixed the issue.