code: def command_exists(command):
      
      for category, commands in iteritems(command_categories):
          for existing_command in commands:
              if existing_command.match(command):
                  return True
      return False
docs: Check if the given command was registered. In another words if it
      exists.