Nonparametric Adaptive Control and Prediction: Theory and Randomized Algorithms