Add option for Mocha tests to use event handlers
Add option for Mocha tests to use event handlers

Creates a new function Battle#on that allows tests and potentially formats
to add new event handlers to a battle. These handlers can then be picked
up by the battle engine for consumption.

At any rate, it's more efficient than hotpatching the getEvent function
within a Mocha test.

Flareninja/Showdown-Boilerplate,aakashrajput/Pokemon-Showdown,TheManwithskills/New-boiler-test,Neosweiss/Pokemon-Showdown,k3naan/Pokemon-Showdown,Kevinxzllz/PS-Openshift-Server,hayleysworld/serenity,Vacate/Pokemon-Showdown,Firestatics/Omega-Alpha,theodelhay/test,kuroscafe/Paradox,CharizardtheFireMage/Showdown-Boilerplate,ehk12/bigbangtempclone,Ecuacion/Lumen-Pokemon-Showdown,TheManwithskills/New-boiler-test,jumbowhales/Pokemon-Showdown,hayleysworld/serenityc9,lAlejandro22/lolipoop,Pikachuun/Pokemon-Showdown-SMCMDM,gustavo515/batata,DarkSuicune/Kakuja-2.0,xfix/Pokemon-Showdown,TheManwithskills/COC,hayleysworld/serenityserver,urkerab/Pokemon-Showdown,zek7rom/SpacialGaze,MayukhKundu/Flame-Savior,KewlStatics/Shit,panpawn/Gold-Server,megaslowbro1/Pokemon-Showdown,sama2/Universe-Pokemon-Showdown,SkyeTheFemaleSylveon/Pokemon-Showdown,PS-Spectral/Spectral,MasterFloat/LQP-Server-Showdown,AustinXII/Pokemon-Showdown,Kokonoe-san/Glacia-PS,TbirdClanWish/Pokemon-Showdown,DarkSuicune/Pokemon-Showdown,Pablo000/aaa,lAlejandro22/lolipoop,MayukhKundu/Flame-Savior,Flareninja/Pokemon-Showdown,TheFenderStory/Pokemon-Showdown,xfix/Pokemon-Showdown,TheManwithskills/DS,Elveman/RPCShowdownServer,CreaturePhil/Showdown-Boilerplate,Ridukuo/Test,aakashrajput/Pokemon-Showdown,Ecuacion/Pokemon-Showdown,SkyeTheFemaleSylveon/Pokemon-Showdown,panpawn/Pokemon-Showdown,Alpha-Devs/OmegaRuby-Server,RustServer/Pokemon-Showdown,TheDiabolicGift/Showdown-Boilerplate,EmmaKitty/Pokemon-Showdown,k3naan/Pokemon-Showdown,arkanox/MistShowdown,AbsolitoSweep/Absol-server,gustavo515/test,JennyPRO/Jenny,AustinXII/Pokemon-Showdown,megaslowbro1/Pokemon-Showdown-Server-for-megaslowbro1,abrulochp/Dropp-Pokemon-Showdown,BuzzyOG/Pokemon-Showdown,PrimalGallade45/Dropp-Pokemon-Showdown,Pikachuun/Pokemon-Showdown,Volcos/SpacialGaze,kuroscafe/Showdown-Boilerplate,KaitoV4X/Showdown,svivian/Pokemon-Showdown,SilverTactic/Dragotica-Pokemon-Showdown,psnsVGC/Wish-Server,Zarel/Pokemon-Showdown,ShowdownHelper/Saffron,Wando94/Pokemon-Showdown,xCrystal/Pokemon-Showdown,PauLucario/LQP-Server-Showdown,NoahVSGamingYT/Pokemon-Showdown,Flareninja/Lumen-Pokemon-Showdown,Irraquated/Pokemon-Showdown,Ridukuo/Test,panpawn/Gold-Server,piiiikachuuu/Pokemon-Showdown,TheManwithskills/Server,Vacate/Pokemon-Showdown,SolarisFox/Pokemon-Showdown,Mystifi/Exiled,Lauc1an/Perulink-Showdown,xfix/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,MeliodasBH/Articuno-Land,HoeenCoder/SpacialGaze,DB898/theregalias,AustinXII/Pokemon-Showdown,kupochu/Pokemon-Showdown,gustavo515/gashoro,abrulochp/Lumen-Pokemon-Showdown,DarkSuicune/Kakuja-2.0,sirDonovan/Pokemon-Showdown,cadaeic/Pokemon-Showdown,azum4roll/Pokemon-Showdown,EienSeiryuu/Pokemon-Showdown,Nineage/Origin,AnaRitaTorres/Pokemon-Showdown,TheDiabolicGift/Showdown-Boilerplate,QuiteQuiet/Pokemon-Showdown,Lord-Haji/SpacialGaze,abulechu/Lumen-Pokemon-Showdown,KewlStatics/Shit,xfix/Pokemon-Showdown,kotarou3/Krister-Pokemon-Showdown,SilverTactic/Showdown-Boilerplate,ZeroParadox/ugh,AWailOfATail/Pokemon-Showdown,Irraquated/Pokemon-Showdown,Atwar/server-epilogueleague.rhcloud.com,BlazingAura/Showdown-Boilerplate,Atwar/ServerClassroom,jd4564/Pokemon-Showdown,KewlStatics/Showdown-Template,ScottehMax/Pokemon-Showdown,PrimalGallade45/Lumen-Pokemon-Showdown,KewlStatics/Pokeindia-Codes,cadaeic/Pokemon-Showdown,CreaturePhil/Showdown-Boilerplate,xfix/Pokemon-Showdown,ehk12/coregit,javi501/Lumen-Pokemon-Showdown,Alpha-Devs/Alpha-Server,Zarel/Pokemon-Showdown,Bryan-0/Pokemon-Showdown,Flareninja/Lumen-Pokemon-Showdown,ShowdownHelper/Saffron,abrulochp/Lumen-Pokemon-Showdown,TheManwithskills/serenity,Zipzapadam/Server,JellalTheMage/Jellals-Server,HoeenCoder/SpacialGaze,urkerab/Pokemon-Showdown,Volcos/SpacialGaze,Wando94/Spite,scotchkorean27/Pokemon-Showdown,TheDiabolicGift/Lumen-Pokemon-Showdown,sama2/Lumen-Pokemon-Showdown,DesoGit/TsunamiPS,lFernanl/Lumen-Pokemon-Showdown,asdfghjklohhnhn/Pokemon-Showdown,lFernanl/Lumen-Pokemon-Showdown,TheManwithskills/Server---Thermal,ehk12/clone,Enigami/Pokemon-Showdown,ehk12/coregit,MasterFloat/LQP-Server-Showdown,danpantry/Pokemon-Showdown,hayleysworld/Showdown-Boilerplate,TheDiabolicGift/Lumen-Pokemon-Showdown,JennyPRO/Jenny,ZeroParadox/BlastBurners,QuiteQuiet/Pokemon-Showdown,Articuno-I/Pokemon-Showdown,DesoGit/Tsunami_PS,abulechu/Dropp-Pokemon-Showdown,JellalTheMage/PS-,psnsVGC/Wish-Server,kupochu/Pokemon-Showdown,kuroscafe/Paradox,TheManwithskills/Server---Thermal,panpawn/Pokemon-Showdown,Syurra/Pokemon-Showdown,KewlStatics/Showdown-Template,DB898/theregalias,TheFenderStory/Pokemon-Showdown,Ecuacion/Pokemon-Showdown,xCrystal/Pokemon-Showdown,EienSeiryuu/Pokemon-Showdown,gustavo515/test,gustavo515/gashoro,aakashrajput/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,BuzzyOG/Pokemon-Showdown,forbiddennightmare/Pokemon-Showdown-1,TheManwithskills/Creature-phil-boiler,Pikachuun/Pokemon-Showdown,Firestatics/Omega-Alpha,sama2/Universe-Pokemon-Showdown,Git-Worm/City-PS,superman8900/Pokemon-Showdown,Hidden-Mia/Roleplay-PS,KewlStatics/Alliance,gustavo515/final,jumbowhales/Pokemon-Showdown,TheManwithskills/Server,Sora-Server/Sora,PrimalGallade45/Dropp-Pokemon-Showdown,hayleysworld/Showdown-Boilerplate,sirDonovan/Pokemon-Showdown,Atwar/server-epilogueleague.rhcloud.com,arkanox/MistShowdown,Neosweiss/Pokemon-Showdown,superman8900/Pokemon-Showdown,AWailOfATail/awoat,TheFenderStory/Showdown-Boilerplate,brettjbush/Pokemon-Showdown,ehk12/bigbangtempclone,sama2/Dropp-Pokemon-Showdown,PauLucario/LQP-Server-Showdown,Enigami/Pokemon-Showdown,hayleysworld/serenity,Lord-Haji/SpacialGaze,BlazingAura/Showdown-Boilerplate,DesoGit/Tsunami_PS,ankailou/Pokemon-Showdown,ShowdownHelper/Saffron,HoeenCoder/SpacialGaze,Mystifi/Exiled,Irraquated/Showdown-Boilerplate,Firestatics/Firestatics46,abulechu/Lumen-Pokemon-Showdown,Syurra/Pokemon-Showdown,megaslowbro1/Showdown-Server-again,Firestatics/Firestatics46,piiiikachuuu/Pokemon-Showdown,Atwar/ServerClassroom,Nineage/Origin,Mystifi/Exiled,HoeenCoder/SpacialGaze,AWailOfATail/awoat,yashagl/pokemon-showdown,megaslowbro1/Pokemon-Showdown,Enigami/Pokemon-Showdown,Elveman/RPCShowdownServer,MeliodasBH/boarhat,PS-Spectral/Spectral,brettjbush/Pokemon-Showdown,Articuno-I/Pokemon-Showdown,Celecitia/Plux-Pokemon-Showdown,panpawn/Gold-Server,sama2/Dropp-Pokemon-Showdown,TheManwithskills/serenity,Alpha-Devs/Alpha-Server,svivian/Pokemon-Showdown,SSJGVegito007/Vegito-s-Server,Wando94/Pokemon-Showdown,SSJGVegito007/Vegito-s-Server,urkerab/Pokemon-Showdown,Git-Worm/City-PS,ZeroParadox/BlastBurners,KaitoV4X/Showdown,Ecuacion/Lumen-Pokemon-Showdown,Pablo000/aaa,Hidden-Mia/Roleplay-PS,Guernouille/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,Lauc1an/Perulink-Showdown,lFernanl/Pokemon-Showdown,DesoGit/Tsunami_PS,asdfghjklohhnhn/Pokemon-Showdown,Firestatics/omega,ScottehMax/Pokemon-Showdown,DesoGit/TsunamiPS,AbsolitoSweep/Absol-server,kubetz/Pokemon-Showdown,TheManwithskills/DS,jumbowhales/Pokemon-Showdown,Sora-Server/Sora,ZestOfLife/PSserver,ehk12/clone,SolarisFox/Pokemon-Showdown,PrimalGallade45/Lumen-Pokemon-Showdown,Celecitia/Plux-Pokemon-Showdown,svivian/Pokemon-Showdown,BuzzyOG/Pokemon-Showdown,jd4564/Pokemon-Showdown,yashagl/pokemon-showdown,lFernanl/Zero-Pokemon-Showdown,TheManwithskills/Dusk--Showdown,danpantry/Pokemon-Showdown,TheManwithskills/COC,Pikachuun/Pokemon-Showdown-SMCMDM,AnaRitaTorres/Pokemon-Showdown,Sora-League/Sora,Sora-Server/Sora,kuroscafe/Showdown-Boilerplate,yashagl/yash-showdown,kotarou3/Krister-Pokemon-Showdown,DarkSuicune/Pokemon-Showdown,lFernanl/Zero-Pokemon-Showdown,scotchkorean27/Pokemon-Showdown,johtooo/PS,JellalTheMage/PS-,KewlStatics/Pokeindia-Codes,anubhabsen/Pokemon-Showdown,TheManwithskills/Creature-phil-boiler,TogeSR/Lumen-Pokemon-Showdown,sama2/Lumen-Pokemon-Showdown,KewlStatics/Alliance,gustavo515/batata,SilverTactic/Showdown-Boilerplate,bai2/Dropp,abulechu/Dropp-Pokemon-Showdown,Guernouille/Pokemon-Showdown,TogeSR/Lumen-Pokemon-Showdown,Wando94/Spite,NoahVSGamingYT/Pokemon-Showdown,JellalTheMage/Jellals-Server,anubhabsen/Pokemon-Showdown,hayleysworld/serenityserver,EmmaKitty/Pokemon-Showdown,MeliodasBH/Articuno-Land,Zipzapadam/Server,javi501/Lumen-Pokemon-Showdown,ZestOfLife/FestiveLife,ankailou/Pokemon-Showdown,Bryan-0/Pokemon-Showdown,CharizardtheFireMage/Showdown-Boilerplate,RustServer/Pokemon-Showdown,megaslowbro1/Pokemon-Showdown-Server-for-megaslowbro1,TheManwithskills/Dusk--Showdown,TheFenderStory/Showdown-Boilerplate,Zarel/Pokemon-Showdown,johtooo/PS,xCrystal/Pokemon-Showdown,Sora-League/Sora,Irraquated/Showdown-Boilerplate,Flareninja/Pokemon-Showdown,Pokemon-Devs/Pokemon-Showdown,Lord-Haji/SpacialGaze,forbiddennightmare/Pokemon-Showdown-1,ZeroParadox/ugh,CreaturePhil/Showdown-Boilerplate,zczd/enculer,bai2/Dropp,zek7rom/SpacialGaze,Enigami/Pokemon-Showdown,Irraquated/Pokemon-Showdown,Firestatics/omega,svivian/Pokemon-Showdown,gustavo515/final,svivian/Pokemon-Showdown,Kokonoe-san/Glacia-PS,TbirdClanWish/Pokemon-Showdown,Flareninja/Showdown-Boilerplate,theodelhay/test,yashagl/yash-showdown,abrulochp/Dropp-Pokemon-Showdown,Kevinxzllz/PS-Openshift-Server,Pokemon-Devs/Pokemon-Showdown,MeliodasBH/boarhat,ZestOfLife/FestiveLife,ZestOfLife/PSserver,Alpha-Devs/OmegaRuby-Server,hayleysworld/serenityc9,azum4roll/Pokemon-Showdown,zczd/enculer,PS-Spectral/Spectral,lFernanl/Pokemon-Showdown,megaslowbro1/Showdown-Server-again,kubetz/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,Sora-League/Sora,SilverTactic/Dragotica-Pokemon-Showdown