Add selector tests and fix minor bugs in selectors.
Support consistent hashing based on multiple fields.