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.
Should we not have some tests to make sure that these events are fired with the correct data?