Improve project detection robustness

No longer depend on shebangs and executable bits being set