rhoapi.js: native bridges fixed and refactored