added opts.recursive and opts.basedir to allow resursive detective calls; created recursive and circular test case