class ChannelModule:
	def __init__(self, circa):
		self.circa = circa

	def onload(self):
		self.circa.add_listener("cmd.join", self.circa.join)
		self.circa.add_listener("cmd.leave", self.leave)
		self.circa.add_listener("cmd.goaway", self.leave)
		self.circa.add_listener("cmd.quit", self.quit)

	def onunload(self):
		self.circa.remove_listener("cmd.join", self.circa.join)
		self.circa.remove_listener("cmd.leave", self.leave)
		self.circa.remove_listener("cmd.goaway", self.leave)
		self.circa.remove_listener("cmd.quit", self.quit)

	def leave(self, fr, to, text):
		if self.circa.is_admin(fr) and fr != to:
			self.circa.part(to)

	def quit(self, fr, to, text):
		if self.circa.is_admin(fr):
			self.circa.close()

module = ChannelModule

@@ -14,16 +14,34 @@
 Module:%0A
+%09require = %22cmd%22%0A%0A
 %09def __i
@@ -87,284 +87,28 @@
 a%0A%0A%09
-def onload(self):%0A%09%09self.circa.add_listener(%22cmd.join%22, self.circa.join)%0A%09%09self.circa.add_listener(%22cmd.leave%22, self.leave)%0A%09%09self.circa.add_listener(%22cmd.goaway%22, self.leave)%0A%09%09self.circa.add_listener(%22cmd.quit%22, self.quit)%0A%0A%09def onunload(self):%0A%09%09self.circa.remove_listener(
+%09self.events = %7B%0A%09%09%09
 %22cmd
@@ -113,18 +113,19 @@
 md.join%22
-, 
+: %5B
 self.cir
@@ -135,39 +135,14 @@
 join
-)%0A%09%09self.circa.remove_listener(
+%5D,%0A%09%09%09
 %22cmd
@@ -148,18 +148,19 @@
 d.leave%22
-, 
+: %5B
 self.lea
@@ -165,39 +165,14 @@
 eave
-)%0A%09%09self.circa.remove_listener(
+%5D,%0A%09%09%09
 %22cmd
@@ -179,18 +179,19 @@
 .goaway%22
-, 
+: %5B
 self.lea
@@ -196,39 +196,14 @@
 eave
-)%0A%09%09self.circa.remove_listener(
+%5D,%0A%09%09%09
 %22cmd
@@ -208,18 +208,19 @@
 md.quit%22
-, 
+: %5B
 self.qui
@@ -220,17 +220,21 @@
 elf.quit
-)
+%5D%0A%09%09%7D
 %0A%0A%09def l
@@ -248,32 +248,35 @@
 lf, fr, to, text
+, m
 ):%0A%09%09if self.cir
@@ -287,18 +287,24 @@
 s_admin(
-fr
+m.prefix
 ) and fr
@@ -363,16 +363,19 @@
 to, text
+, m
 ):%0A%09%09if 
@@ -394,18 +394,24 @@
 s_admin(
-fr
+m.prefix
 ):%0A%09%09%09se

fix event handlers