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.