Added tests for chart gadget, better handling of error cases.
Added tests for $.addChartGadget and createChartGadget.