Core/messages: New IRC parser.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit fa77d6fd6108c74a8e05e49de9b14cfad78e845c)