Build: Don't assume the browser environment; smoke test on Node w/ jsdom

Fixes gh-1950
We'll need to update Jenkins jobs to use `npm test` instead of `grunt` what they do now. I'll do it.