change the function name; s/find_dir_having_target/find_dir_has_target/g
add *_datadir() to compute data dir paths
remove subdir parameter passed to the constructors of Scanner and Analyzer classes