An option for providing a custom legend fragment formatter.

I'm currently writing a legend plugin so dashes and symbols can be displayed in the legend.

If option specified then a custom fragment formatter will produce the html for the legend entries.
Still uses table format.
Changed to use DOM elements for the legend construction rather than strings.