San Francisco Finally Cleaned Itself Up. Here's Why It Took So Long.