PHP class for calculating elo rating