First pass at refactoring filter execution

This is the beginning of addressing #523.