[BUGFIX] Fix basic support for packages with multiple PSR-0/4 mappings
Some (3rd party) package define multiple autoload mappings for
different PHP namespaces in their composer manifest, for example::
Flow does not yet support multiple autoload mappings but it always
just ignored everything but the first mapping.
With I20777f78f63f512a104c4e144aa29cbedafe0f23 this is no longer the
case and an exception is thrown for packages with more than one
mapping per autoloader type.
This change reintroduces the previous behavior and fixes some minor
bugs along the way.
Because ``Package::getComposerManifest()`` returns a ``stdClass`` the
code ``count($namespaces) === 1`` always evaluated TRUE.
By casting the manifest to an array (for better HVVM support) this is
no longer the case and the exception is thrown.
In the long run we should replace the stdClass by an associative array
or DTO and introduce real support for multiple autoload mappings.
This change also fixes some minor issues and adds some unit tests.