Split filter into two functions: filter and replace

The new filter function rejects whole events.

The replace function replaces regular expression matches with the
provided substitute.
Use icsfilter class's new methods