Detect a Drupal 8 site without composer.json for issue #1975220

Seems like the code could be reverted as originally suggested in this PR (testing for core.services.yml).  The tests for the 'core' directory and 'composer.json' in the Drupal 7 case can potentially just be removed, as this test is inside a nested condition that requires that 'index.php' must exist.  This file typically does not exist in the 'core' directory.

Some caution might be warranted here, though; there might be an index.php in core if the front controller is moved from the Drupal root to the core directory in the future.  Hopefully, if this is done target file would be called something other than index.php, though.