added some event trackers to the apply etc links [READY TO MERGE]

@msf4-unikent this is ready to merge now. It should basically work ok, but we might need to refine the tracking codes once we've got it up and running.

Note that it includes some changes to the STA apply etc links that Justice did in a separate branch (see issue #194). This is because that work affected the same files, and the merge didn't work cleanly.