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
Use 'window' check to determine Node/phantom env.
Merge pull request #6 from pandell/mocha-phantomjs

Support mocha-phantomjs test environments.