On dreaming, I find that my brain "problem solves" in my dreams. This happened quite a bit when I was in IT, and writing code. I would see "solutions" in my dreams. Fortunately, they were vivid enough that I could remember them, and implement the next day!
As for timing, I've always been able to wake myself up at a certain hour, even from a dead sleep. If I had an early morning plane to catch, or some other meeting, I could "wake myself up" just by thinking of the time before bed.
Wow, must be nice!
Mental illness is a bitch on a brain and I have none of those handy traits. Wish I did.