Implemented serialization functions for components.