A century ago, people with symptoms of obsessive-compulsive disorder (OCD) were sometimes institutionalized for life or treated with frightening operations such as frontal lobotomies.