New hook: on_mode_change()

  Called when the mode changes.