Better name for constant.
Inverted if-condition for simplification.
Added constant for foreground color code index.
Escape html entities while parsing the IRC message.

Now escapes html entities during the parsing of the message received
from IRC and added a unit test for this requirement.
Renamed format* methods to styleAs*, since this is more appropriate.
Style fixes.
Use group name as unique ID.
There is nothing broken: if a reason is provided, the window is not closed
automatically.
Reviewed some TODOs.