New York is trying to improve both its mental health system and its criminal justice process. Other cities are watching carefully.