Simplify how substituting values works

The original purpose of this PR was to add a test for AnyValues filters, but it got a bit out of hand fixing the existing code.
Will add comments.

The t argument is the same argument as in subst-filter-set, but since the entry point has changed we need to change how the value is threaded down.