Refactor the AST

refs #7622
Optimize apply/object filters

refs #7622