[HOTFIX] Add classes to legend rows/entries

Rows on Legend now have the row text as a CSS class.
Entries on HorizontalLegend now have the entry text as a CSS class.

In both cases spaces in the text are replaced with dashes.
Merge pull request #1287 from palantir/hotfix-legend-classing

[HOTFIX] Add classes to legend rows/entries