Split out lightcurve extraction from data out of init_statement, PEP8 changes