Infiltration refactor

Refactors stuff to make new spy abilities a bit easier to implement.
See #6145 about the sonar pulse, but that's not specifically related to this.