RPC Client support

added RPC client support, borrowed heavily from AutoBahnJS, also tried to keep compat high with it so the code can be used both in node and browser