Daydreaming in Humans and Machines: A Computer Model of the Stream of Thought