Optimize namequery
Make code look better.
Implement crossfactionbg's v2.0. This version selects player's destination team as soon as the queue pops. Which makes it safer and interfers less with the existing battleground system.

Limit the decimals on rewardgold to 2 decimals only (not sure how they are rounded off, but i don't really care either)
Fixed arena endings. (see UpdatePlayersCountByTeam(team, false);                  // +1 player)

This still needs to be tested on a live server. But no problems are expected.

Tested: Joining alone, and joining as groups in BG's. Arena's are completely untested but should work like a charm since they are not affected by any of those functions at all.