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.
Can you explain the new `t` argument? Also, can you add a comment connecting the change to the paper?