Move .cfignore logic into its own interface

This will make it possible to test this logic without
using the file system

[#67413512]
Add test for cf ignore