Rework javascript and make pygal work