Added ENVIRONMENT_IS_WEB test prior to checking window.crypto etc. so we are sure that window is defined