Pass 'window' to wrap functions for browserify support.