Use module pattern for timeseries. Add unit test for Timeseries.toPlot()