major refactor, remove global vars, added irc example