Big refactoring of javascript data and charts.
Possible broken parts remaining