Moved CCDCTimeSeries._todict out of class and renamed as mat2dict