Online Optimization with Memory and Competitive Control