Disable destroy links

Fixes bug #1368592: disabled links were still working due to events being attached to click instead of listening for the fired event.

The machine token creation and rendering code has also been refactored to remove duplication and allow the event attaching code to only be added once.
We have some tests that check that clicking on the links does the correct thing (by proxy of these events) did you want me to add something specifically to check that these events are hooked up? If so I'll add them in a follow up, to get this landed now.