Refactor setFilters using Array reduce

Small refactoring of #202.

@wolfbiter, are you OK if we call `setFilters` from `setFilter`, not the other way round?