Decouple class and resource services
Another refactoring, similar to the one for predicates. (Sorry for the size!) The main difference is that the resource service is not fully decoupled, because I need to make other changes for "specialized" resources, such as research problems. It is a good step first step, though.