Refactor algorithm for choosing which pages to show.
Add tentative ellipsis width setting to limit maximum.