declaring variables correctly in javascript
moved TProtocolException to thrift.js, exported
added proper handling of required fields