Support mocha-phantomjs test environments.

`mocha-phantomjs` reporters [can only require other reporters and should use process.stdout.write to report progress][1].

This modifies the teamcity reporter to first try the phantomjs environment and fall back to the Node environment.

[1]: https://github.com/metaskills/mocha-phantomjs#third-party-reporters