Reviewer Rob - Contact filtering

This is the code for the contact filtering function.

I've UT'd everything but `filter_bindings_to_targets`, `binding_to_target` and `prune_targets` but the golden paths through them are already UTd by the existing UTs.  I'll add error paths while you review the rest.
I'm not a big fan of functions that get called on everything, but hide logic to do nothing on most arguments - they're too easy to use wrongly later, and make the mainline flow hard to understand without jumping into subroutines.