resolve deprecation warning by implementing filter manually

It is a shame that `filtered` is deprecated. Maybe an onther way is
to use an iterator, and then use `filter` on the iterator. Or there
might be an other method that is applicable here. For now, I created
a `Filter` trait that I implemented for `Option`.