Add `Encodable` and `Decodable` implementation when no shared data is involved.

There is an implementation for the DBVT, but it is a fail! since the circular case is not handled
yet.