Don't used defined(window) because window is not declared.

In fact, avoid `window` entirely and just check for the existence of a
global `performance` property.

This fixes issue #1457.
Merge pull request #1458 from AnalyticalGraphicsInc/avoidWindow

Don't used defined(window) because window is not declared.