fix pkgs_dir_prefix() for multiple envs_dirs; update tests