Avoid crashing for false positive path

The building process was crashing when a good path was found but not the one with the `component.json` file.
Added test for path name collision
refactor test
fix dir collection in lookup
Merge branch 'integration'