Add Support for "top x" and "threshold" Filters in WorkflowManager

- in export() and output()
- also modified tests
- also wrote a new method that does the filtering
(cherry picked from commit 94efcc14eaa2b3bc522c6e90f64ce42dc632025d)