Fix several ignore and attribute file behavior bugs

Fix #2276, #2277, and #2278 

See the specific bugs for more detail. The high level description is that this fixes:

* Ignores were being "popped" during directory iteration if the suffix of the directory matched the suffix of the parent directory.
* Attribute macros might not be loaded before attribute files in subdirectories were parsed
* Match patterns like `/**/*` (and trailing `/*` on patterns in general) were not being treated the same as core Git