(maint) Move Dir.entries to private method for testing
Previously, if you ran the opkg_spec in isolation, it would add stub the
Dir.entries method causing facter to fail to load external facts in
facts.d.
This commit moves the directory access to a private method that we can
stub without affecting other parts of puppet.