A century later, science backs some of the crazy ideas in Freud’s book on the interpretation of dreams