Update hprose for JavaScript

Refactored some code for JavaScript.