create function in timeline.js which parses though events from json and puts the into a format that the d3 file is expecting