add main field to package.json so that module can be required
use 'this' as a root only if 'window' object isn't available