scala: runtime library with trait ObjectCodec