Revert "Remove check for file match"

This reverts commit a7347d49c76e20c606d36f7a298cae909ba751ef.
Clean / fix path
Use faster indexOf
Pass config array to parent