Clean JSONRPC and remove unused code.
Change Output to be a generic std::function.