Add support for git-specific ignore patterns

Negated patterns

.gitignore can contain negated rules, ie. "!*.jpg"

This can be useful when ignoring "everything but", ie.

--- .gitignore
/*
/!img/
---

This will ignore all files and dirs in the current dir, except /img/

Leading slash

Git ignore patterns with "/<pattern>" is interpreted as <pattern>
in the current folder. Support this by matching the pattern without
leading slash.
Update tests