[NS09] Implement the new ranking code

At this stage, this is turned off. Unit tests will be
in a followup change.

Test: In a followup
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I4448a3546fbc1a3dddf757982c031c5f39ba2889
Change-Id: I4448a3546fbc1a3dddf757982c031c5f39ba2889
  (cherry-picked from ag/14010222 with fixes)
10 files changed