Add serialization to Line and Text