Migrate from MutableClassDescriptor to ClassDescriptorWithResolutionScopes

Cast to MutableClassDescriptor where needed. The code with casts will be removed shortly
Minor. Formatting fixed