Refactoring for API friendliness

-added logic to determine team based on player
-code cleanup
Merge pull request #4 from chongtastic/master

Refactoring for API friendliness