Implement filter logic

Implement and test the filter logic defined by except and only.

Edited by Frank Sauerburger