I think that dreams are basically the resultant of the mind's efforts to solidify the contents of long term memory. I think short term memory leaves temporary impressions on one's brain, along with perhaps tags on long term memory where conceptual inter-relationships are kind of an "org chart" of the mind, that which maps our memory in a way that allows us to access it "on the fly. In doing so, the meaning of the day, the meat of it... what it meant to you, for you, literally changes your mind to encorporate the stimulous into the "rational" place for your particular org chart.
They are the wood the frame you use to frame future events. During the day a lot of operational activities are the main focus of mind, but at night - it's time to update the programs and reboot. At some point during the sleep process, your short term memory must get activated in a feedback cycle. Hmm.. that made me wonder if feeding a visual of the org chart updates back into that from whence it came is a reset signal to purge short term memory - quite literally "freeing memory".
So perhaps dreams are a part of the sleep cycle where short-term memory is activated, which due to the source of its activation causes its informational content to be diminished. The activation of short-term then results in one becoming conscious of mind while it's in the middle of maintenance mode and unbounded by real-time stimulous.
The more times you go through the sleep cyle, the cleaner it gets, like degaussing a tape. When you wake up, you fill it up again and sleep and again and on and on then you die.