Fix nodejs support
Merge branch 'nodejs-fixes' into standalone

Conflicts:
	src/crypto/random.js
Changed comparison in window check