Wraps a line of text to a given max-width, and returns the resulting lines, trimming whitespace characters around wrap points. The compute-width block takes a string, a from-position and a to-position (non-inclusive) and returns the width. The can-split block takes a string and a position, and returns true if we can split at that point. The is-space block takes an integer code point and returns true if it should be trimmed.