cleanup, including fix multiple charts on page

I carefully went through and moved the chart-specific variables and their functions into the directive. This fixes pull request #28 and pull request #75.

The easiest way to trigger it would be to have two charts with two copies of their config and ids assigned to all the series and then change something, say series.type, on one of the series. Neither series would react.

I haven't tested that, but I have checked the new version works :-)