[RFR] Reusable chart (fixes #7)

This PR aims to simplify and clean current code.

It also add some parameters to the chart, following the [Mike Bostock's reusable chart pattern](http://bost.ocks.org/mike/chart/) guidelines. Thus, integrating this chart in another project should now be easier.

Note: several coding style issues in this PR. Will be fixed in a dedicated PR, to not pollute code review.