command: Factor command name matching out of command.c.