Alternative check for Node.js context.

A stray global `window` variable was causing revalidator to be unusable as a module.