Time-Varying Optimization and its Application to Power System Operation