Refactored query pipeline for ats. It builds a query filter expression and
later converts this into an executable table query.