Fix some style errors
Merge pull request #1129 from kotarou3/tournaments

Fix some style errors
Add gulp-replace to devDependencies
Fix faint-switch mechanics for gens 1-3

The model is now:
- Gen 1: fainting ends the turn
- Gen 2-3: fainted mon is immediately switched, and the turn continues
- Gen 4-6: fainted mon is switched at the end of the turn
Remove a stray debug line
Gen 3: Traced Abilities don't run Start events

Specifically, things like Intimidate don't happen when Traced.
Fix Trace

The previous implementation of Trace is difficult to understand
and has a lot of weird bugs. I'm mostly sure this is what it
was intended to do.
Log ac accounts of locked/banned users
Fix tournaments permissions

Previously, ROs/leaders couldn't enable/start tournaments
Comment gen 3 switch mechanics
Fix weird behavior on double-faint in early gens
Gen 3: Fix Trace bug from 065e293c
Merge remote-tracking branch 'upstream/master'