Pie chart legends

Added support for legends with pie charts.

This involved factoring out from legend.js all knowledge of stackable charts. I added a more general function to base-chart.js, legendToggle, which was meant to work similarly to legendHighlight and legendReset. Stack hiding and pie chart filtering through the legend now work via this function.