Issue #393 Adding missing fire event for onClose with file rendering

Issue #393 - Adding more tests and refactoring duplicated file transmitter code
We'll need to do some rationalisation here with all these transmitters.

Let's not do it in this PR though. Let's fix the issue at hand, then look at what we can do later.