Ability Refactor: Abilities now listen for End events

Added functionality for setAbility to send End events to abilities.

Fixed bug with Mold Breaker negating all Battle#singleEvent ability calls,
even those that don't involve damage calculation.

Fixed Skill Swap to now use End and Start events in the right order:
send the End events, then change the abilities, then send Start events.
If the same ability is swapped, don't send End events (the game simply
re-activates the abilities in question)

Moved SwitchOut/Faint events from weather to ability so the weather
can interact properly with Cloud Nine or Air Lock.

Primal weathers persist if a Pokemon with the relevant ability is
on-field, even if the originator switches out.
Merge pull request #1334 from ascriptmaster/primal

Ability refactor - Abilities now receive End events properly