Better .gitignore parsing

This fixes #254 @bausmeier