Text this: The height of piecewise-testable languages and the complexity of the logic of subwords