referee refactor

split some game logic into a referee class