Some more test code added.
Removed junk code used to test in process of moving to more rigorous testing.
Added more cases to consider.
Tweaked 'tests'
Added back bar charts
Finished debugging -- weirdness is due to handling of labels and query to extract the data. Time for a refactor.