Model Selection with Near Optimal Rates for Reinforcement Learning with General Model Classes