A Nonstochastic Control Approach to Optimization