The man in charge of an enormous American aircraft carrier that crashed into a merchant ship has been relieved of his command.