Pass functions in higher-order correctly.
Add in lookup_command_name (for replies, errors).