So, Moffat's doing one of his favourite tricks - setting one important strand of the story off in a side setting that appears to have no connection with the main storyarc. The Girl, her father and Dr Moon certainly provided some of the more fascinating parts of the episode.
So, just imagine... You've got a brain the size of a planet, and suddenly you're all alone with little to do and nobody to talk to for a whole century. So you do what the Toclafane did: you regress yourself to a child, and transport yourself to 21st-century England--only for you, it's just a self-imposed virtual reality. It's a way to stay close to sane and close to happy.
Now imagine you're building the library. Problem with a computer the size of a planet: how can you possibly maintain it? How can you make alterations, or fix problems? You'd need a really powerful diagnostic computer, and you'd need it to be nearby. So you hollow out a great big moon, build it inside that, and and put it in orbit.
The diagnostic computer is simpler, and more stable. It's stayed aware of what's going on, but it let CAL have its fantasy. But now there are lives at stake, so it's projected an avatar of itself into CAL's world to gently pull it back to reality. Naturally, it came in the form of Dr. Moon, psychiatrist. (spotted on Television WithOut Pity, and so, so much better expressed than I could have done)
That seems the most obvious explaination. However, it's Moffat we're talking about and I don't think it's quite that simple. Around 9:41, you can see CAL inscribed on a briefcase on the floor, and CAL is more of a man's name. I wonder whether the father is meant to be Cal, and The Girl is more of a new system coming online, learning how to operate the system, etc. Literally next generation.
And then there's River Song. Possibly a Time Agent (51st Century, same squareness gun as Jack had), definitely knowing the Doctor in the/his future. However, she doesn't know Donna by sight, but definitely by name, so the Doctor's talked about her to River.
Chances of her surviving next episode though : very low. I really think Moffat's the type of guy who would (and has already, with Reinette!) introduce the love interest and kill them immediately. It's the sort of timey-wimey thing he loves, to have the first time Ten meets River to be the last time she meets him.