Humanity and the Forerunners were never close allies, they barely communicated with each other, just tolerated their existences. Humanity had no time to have a nice little chat, so they purged Forerunner infected worlds to quickly eliminate any threat of the flood. And naturally, if you were under attack by a powerful empire you would defend yourselves at all costs, and that's what the Forerunners did, hence the huge Forerunner/Humanity War.
A thing to remember is that the humans were colonising the planets right after destroying them, which was about 50 defenseless Forerunner colonies. The Forerunners and Humans were already rivals due to the Mantle-of-Responsibility, also Humanity had expanded their empire at a rate not seen in the galaxy before, it was threatening to completely overwhelm the Forerunner Empire, and then the destruction of Forerunner worlds was the last straw which sparked the war.
Only a handful of Promethean Warrior Servants were transcended into Promethean Knights, it was a vast majority of devolved humans who were changed for the will of the Ur-Didact. The Ur-Didact saw no use of humanity and used them for his purposes.
It's a bit harsh on the Librarian, you try to make a perfect plan that is to work in over 100'000 years time that works flawlessly. No one else would've even attempted to imagine such a plan, yet she attempted it, and did pretty damn well. The Flood that were in research stations were there, to be researched on. They were left over from the Forerunner/Flood war since all life in the galaxy was annihilated.
The Ur-Didact had a strong hatred for humanity which was justified. Humanity destroyed everything he held dear (clearly except for the Librarian), they were trying to overtake the Mantle-of-Responsibility from the Forerunners, which the Forerunners believed was their birthright. So in his mind, everything he was doing was justified against Humanity, they were a threat to the Mantle and had to be removed, which is why he destroyed them.
I will agree with the Elites, however, I will say that Bungie also screwed them up in Halo Reach. They were perfect in the trilogy games, but were mucked up right after with Wars then Reach. 343i just didn't fix it.
I personally had no problems with understanding a thing about Halo 4's campaign, I found it very easy to comprehend without researching on the Terminals and the new Forerunner books that came out. Although, I did research before the game came out, so that could've aided my understanding, I dunno.
Which part of what the Librarian was talking about confused you? I could answer that.
Cortana is a Smart AI, hence she has human emotions. She's not the only AI to get attached to people/creatures either, AI before her have done so too. I will say that her death was silly, although making sense, was just stupid. I never saw her as a comic relief character either, I saw her as the second main character for the series, one with development and a personality, unlike the Chief until Halo 4 (excluding the books). Her death was meant to mean something, and drive Chief down into depression because he lost the only friend he had. He was very alone, and lost everything over his years growing as a Spartan, clearly this would impact him.