Extract artificialTokenEdit directive

Useful because we have easy access to the `state.change` function there -
something we absolutely want, so that we trigger the need for a save, make an
entry in the history etc. etc.