pytgl: Move callbacks to separate file