global_mode() is the new LUA primitive.

  This replaces get_mode()/set_mode().