Refactor: Add three argument versions of FOREACH_{NODE,TICKET}.
These take an additional argument that is the config object. Nothing
uses these at the moment - I'm going to move callers from the old
renamed versions to these over a bunch of commits.