THRIFT-2844: Nodejs support broken when running under Browserify  

Updated PR based on the current master branch