Categorical resolution of singularities