Correctly add and remove machine and container tokens including their committed state.