Crime, homelessness and Democratic divisions over the issues took center stage Tuesday as a liberal prosecutor in San Francisco was recalled and seven states held primaries that helped mold each party’s image heading into November’s fight for control of Congress, statehouses and major cities across the country.