updated js wrapper for bindings, added test cases for both native bindings and js bindings