Infiltration refactor

Refactors stuff to make new spy abilities a bit easier to implement.
See #6144, but that shouldn't be solved here.