Estimation and inference for Q-learning