Add support for passing the target to ircprivmsg() and ircnotice() functions and refactor them to reduce code duplication.