Add `define_negated_matcher`

This replaces #547.
Fixes #527.
Fixes #493.