Add serialization for annotations.