In order to be able to properly resolve package ordering,
the package manager resolves the dependencies of packages.
For dependencies to TYPO3 extensions, the Extension key is
used as dependency name. To resolve the extension key from
the composer name, an internal mapping array is used.
Dependency objects of each extension Package are created
on construction of the Package object. It can now happen that
composer package typo3/cms-backend is created before typo3/cms-core
is created, which leads to the situation that the package
typo3/cms-backend references typo3/cms-core as dependency, not
the extension key "core", which will later be expected during package
sorting by dependency.
To fix that, the mapping array is now created early, before any
TYPO3 extension Package is created.
Also make sure the list of composer (only) packages is cleaned from
TYPO3 extensions.