refactored matchCommand

groups[0].trim().equals(command string) replaced with a slightly tidier
helper function.