Royalty, presidents, prime ministers and a legion of faithful have paid their respects during the funeral of Pope Francis in St Peter’s Square.