Prediction and Control with Function Approximation