Dir#open,foreach,path and refactor coercion