Finalizing improved auth API.
Pulls latest from master.