Added unit tests.

Had to rework the way the module is initialized to facilitate mocking
the IRC client object for unit tests.
Cleanup and documentation.