Change _import_module safe default to True, and simplified _locate_function.