WASHINGTON (Reuters) - Richard Cordray, the director of the U.S. Consumer Financial Protection Bureau, formally resigned on Friday and named a deputy director as his replacement, setting the stage for a political and legal battle over the regulator's leadership.