Complete rewrite of JSON-RPC

A very different JSON-RPC interface based on type classes.
The way the library is written now makes these tests redundant. I can add them if you wish, but I don't see much value in them anymore.