Support custom detective

The same implemention as https://github.com/substack/node-detective/pull/35