Re-factoring of lightcurve functions into lightcurve class.  Added convenience command-line script as well