Added json rpc thingies, and test for it