Update detect

Simplify the detect script and check for composer.json as the first file as most projects would have a composer file and a webroot directory instead of inline index.php.