JavaScript actors with asynch JSON-RPC and pub-sub messaging