Refactor formeChange
Refactor formeChange

This fixes an obscure issue where we sent a formechange-to-self on
faint in certain obscure situations (apparently including Gen 4
Custap?)

In case anyone wants to investigate the details (this commit just
patches over some symptoms), the relevant replay is here:

https://replay.pokemonshowdown.com/smogtours-gen4ou-425031

urkerab/Pokemon-Showdown,svivian/Pokemon-Showdown,svivian/Pokemon-Showdown,panpawn/Gold-Server,sirDonovan/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,Enigami/Pokemon-Showdown,xfix/Pokemon-Showdown,xfix/Pokemon-Showdown,Zarel/Pokemon-Showdown,panpawn/Gold-Server,svivian/Pokemon-Showdown,xfix/Pokemon-Showdown,svivian/Pokemon-Showdown,svivian/Pokemon-Showdown,AustinXII/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,Zarel/Pokemon-Showdown,xfix/Pokemon-Showdown,Enigami/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,Enigami/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,urkerab/Pokemon-Showdown,urkerab/Pokemon-Showdown,AustinXII/Pokemon-Showdown,AustinXII/Pokemon-Showdown,xfix/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,panpawn/Gold-Server,Zarel/Pokemon-Showdown,Enigami/Pokemon-Showdown