Added option applyFilterToDirectories so that the matchRegExp can optionally filter directories as well as files.