Added directory filter function

This filter allows the user to add rules for which directories (including
subdirectories) that should be ignored based on their content.