Use window if 'this' is not defined when using browserify 'require' function

Signed-off-by: Ryan Chen <ryan.chen@turn.com>