Refacter jsonrpc and gobrpc to codec.go