Improve filter perf

Use single-pass traverse() to map inputs to booleans, then run step to
retain only items with corresponding true result. Improves perf for large
input arrays and for predicates that return Promise<boolean>.