Handle commands with a dispatch table.