Refactor JSONRPCServer, add JSONRPCException