Halo 4's story was a big excuse to get rid of Cortana. The Didact was just a side story
English
-
It obeys all of the lore though. Cortana was gonna die at some point and anyone who read The Fall of Reach new that. 343 managed to use that as a great central plot and give some character development for both Cortana and a normally featureless Cheif.