Add in HorizontalLegend.

Lists entries side-by-side in the available width, after which the
entries wrap onto the next row. If an entry is too wide it is
truncated. If there are too many entries some rows will not be shown.

Close #755.
Strict text comparison is fragile since the specifics of wrapping may depend on the machine running the tests. The best I can do is check that the longer lines end in "...", but that would be unreliable if we later change the truncation style.