Reorder functions.
Make check_ and filter_file() interfaces match.
Reorder functions.
Add utility subcoroutines for filter construction.