[smart-select:] import recent changes from google3.

(1) Strip some Google-specific links (http://cr/150751377)

(2) Improve and add tests for registration mechanism:
http://cr/150679054, http://cr/150792974, http://cr/150899682

(3) Extra regression tests: http://cr/150939660

Test: everything builds, no significant change of .so size.
Change-Id: I177ba12b8d0cdcd615619f8ecd960cbcb0b26a77
15 files changed