Allow purl to eval in a non-browser environment

During the build process of a project I'm working on, purl gets evaled by https://github.com/jrburke/r.js, which is running on node, and as such there is no window object.

This commit makes some very small changes to allow purl to eval and to work on a non-browser environment, namely it does not require `window` to exist.