Code cleanup, added comments, moved tons of the player functionality to activePlayer instead, updated local unit tests