fix prefer variables, add prefer_first_in_directory
use prefer_first_in_directory behavior in the default build file detection
add docs on prefer_first_in_directory