Online Optimization and Learning in Uncertain Dynamical Environments with Performance Guarantees