Replaced String class replacement with Matcher class replacements.

Using String class replacements ignores any modifiers (e.g. Pattern.CASE_INSENSITIVE) used by the Pattern and Matcher classes. This caused the removal of the Pattern.DOTALL flag to have no effect, and the String class replacement would perform a case sensitive replacement, thus making no replacement even for a successful match with Pattern.CASE_INSENSITIVE.

Pattern.DOTALL was removed as multi-line mode is unhelpful when performing matches on IRC, which is primarily a single-line protocol.

Descriptive comments were also added to the source code.