Made debugging optional and an option that can be enabled in the config file.
Merge branch 'refactor-config' into true-refactor

Conflicts:
	index.php
Clean up index.php and remove all usages of write_socket and replace with functions that abstract basic IRC functions like nick changes, connection registration and identifying.
Fixes problem with the parameters of the authenticate function.
Moved the QUIT command to a function in functions.php
Moved the PING response (PONG) to a function in functions.php
Hide away more common raw commands (KICK, NAME)
Improve closing output with properly closed HTML or plain text (depending on debugging type) and numeric exit codes.
Fixes undefined variable in peak module caused by a typo... again.
Fixes message parser issues which solves numerous undefined offset notices in index.php.
Simplified & consolidated message parsing logic.
Update documentatoin of BaseBotModule
Ensure modules directory is loaded and modules are loaded. If not it's an error and we quit.
Fixes all known undefined index warnings in index.php.
Fixes warnings in Peak module, caused by calling filesize() on a file that doesn't exist.
Rename BaseBotModule->channel to channels and correct type hinting in comments.
Create extensible logging functionality and replace "if (debug enabled) output" pattern with a single call to "Logger->log()".
Refactor out redundant code. BotModule->parseName()
Finally added a configuration manager. Let the games begin.
Fixes bot attempting to reply to itself when it receives a PM from a user rather than a message addressed to a channel.