Fixed total breakage of HashRing in 9d1cd9a.

* This had PHP warnings but no errors, but was broken.
* Added some unit tests for this class.

Change-Id: I7c7ea2c30ca747aae7a3c3951fc33c69052de085
Merge "Fixed total breakage of HashRing in 9d1cd9a."