bunch of changes. refactored a lot of d3 line js

it works fine. i need to modify a lot of code for applying transitions.
Several changes to d3 line.