rpcstub js

add context handling