The height of piecewise-testable languages and the complexity of the logic of subwords (Logical Methods in Computer Science, 2019)