Complete rewrite of JSON-RPC

A very different JSON-RPC interface based on type classes.
Why remove these tests? Are they no longer relevant?