Egypt's top judge, Adly Mansour, has been sworn in by the military to replace ousted President Mohamed Morsi.