irc_mode: Send proper error replies
irc_mode: Add unit tests