Extract the create_subdir function

Also modify some behavior of '--pre'.
Rename filter to ignores

To avoid confusion of the Python built-in 'filter'.