Instead caching text layout info (Line structs) in IntervalCache, which was slow and had to be updated every frame, cache them in CALayers.
There's missing piece, which is that some caret navigation is layout dependent (move up, move down, etc.), and if the caret is off the screen, we'd want to cache that layout info too. This isn't a big deal for a single caret, but becomes more important for multiple selections. Tracking in #118.
Fix a bug where putting a caret at the beginning of the last line and pressing Shift-Right Arrow, would panic.
Rewrite Rope.LineView to no longer have a separate endIndex after the Rope's endIndex (omg what a relief).
Only validate BTree indices with preconditions at the boundary where external code passes in an Index into a Rope/BTree API. Use debug assertions at BTree internal function boundaries. This improves performance by validating less.
Remove BTreeMetric.type and allow each metric to be measured on both leading and trailing boundaries.
Rework the BTree Collection adapter APIs to use this functionality, and extended them to take a Range argument that lets you use them for slice types (Subrope, Rope.UnicodeScalarView, etc.).
Made Spans a Collection and added SpansSlice. The latter improves AttributedRope performance.
Add a count(in range:) method to the BTree Collection adapters. This relies on the leading/trailing boundary changes above, and was necessary for Spans' Collection conformance as well as SpansSlice.
Made AttributedRope.Runs a collection and removed some awkward APIs for reading AttributedRope.Attributes for a specific index.
Rearchitect Heights to use the new support for boundaries in BTreeMetric, which cleaned things up quite a bit.
count(in range:)
method to the BTree Collection adapters. This relies on the leading/trailing boundary changes above, and was necessary for Spans' Collection conformance as well as SpansSlice.