Core/Phases: Some changes to how phasing works

(cherry picked from commit e4f6cb39a2652455b78ae2416627954956c8964f)
Core/Phases: some commenting, more cleanup and compile fix

(cherry picked from commit 8b536fdf9d38a3e0c94dc9c1184ea8582495064f)
Core/Phases: fix logic in SetInPhase()
- we should not remove the terrain swap if another phase still use it

(cherry picked from commit 299c693b8420d81951ef67b8481e4ad6b192473f)
Core/Phases: Some minor changes, added SQL structure.

You can now bind terrainswaps to specific phase ids, these phaseids are applied by spells.
Still ToDo: Free terrainswaps.
Core/Phases: Added a new table, terrain_map_info, where you can bind a specific terrain swap to a map, and it will be sent to the player when he enters the map.

ToDo: Add conditions support for this.
ToDo: This data is already in the DBC (parentMapId) but is it complete? This way allows us an extra degree of freedom if / when we need to add extra information to this table.
Core/Phases: only send packets to players, also fixes compile
Core/Phases: sql naming updates
Core/Phases:
* Implement CONDITION_TERRAIN_SWAP
* Get rid of CONDITION_SOURCE_TYPE_PHASE_DEFINITION
* Implement CONDITION_SOURCE_TYPE_TERRAIN_SWAP and also throw it in WorldObject::RebuildTerrainSwaps
Core/Phases: Rebuild the terrain swaps whenever a quest's status changes.

Author: @Subv
Core/Phases: Rebuild the terrain swaps when a quest is removed as well (and some other scenarios)

Thanks to @joschiwald
Core/Phases: Removed some of the usages of phasemask in the Pet code.
Core/Phases: Get rid of IsInSamePhase
Core/Phases: add table for corpse_phases
- set all phase related fields to unsigned
- remove old phaseMask from corpse table
Core/Phases: removed phaseMask from corpse queries
Core/Phases: implement loading of corpse_phases
Core/Phases: more work on corpse phasing
- moved all sql queries to prepared statements
- implemented corpse phases saving, loading, cleaning
Core/Phases: fixed corpse phase deleting
Core/Phases: gamemasters should see all phases with gm on
Core/Phases: apply phasing to bones when converting from corpse
Core/Phases: some cleanup
- implemented CopyPhaseFrom(obj)