Refactored the Registrar to push the operations to the callers.

Review: https://reviews.apache.org/r/19372
Changed tabs to spaces in master.cpp.
Fixed a bug to properly re-register an authenticating framework.

Review: https://reviews.apache.org/r/19542