MOdified to load configuration from window context or sessionStorage.