Support more advanced filtering for the synonym excludes.

Fixes #159.