Standardized toJSON, fromJSON, toString and fromString interfaces