Improve util.walk

I fairly subtle but I think important change in functionality

- The `filter` function is always called on directories (previously not called if `ignoreFolders` is set to `true`) which I think is more correct.
- If the `filter` function returns `false` for a directory that directory won't be walked further.
- The `ignoreFolders` options now only determines whether or not the iterator function (the function thats called on each item while walking) will be called for folders. (Which is how also it worked previously.)