Fall back if require('esprima') fails in node.js

Most versions of node.js throw an exception when the window variable is used without being set.

I assume this fix preserves the intended behaviour when window and esprima are not available.