The departure of the CFPB director comes as congressional Republicans look at changes to the agency and Democrats defend it.