Tries to work in Node/CommonJS environment