Switch `detect` to `detect(src)` and add `detectFile(path)`

Closes #2