Text utils (flattening and normalization).