Break script up into managable modules.  Add some chat-reading smarts.