Code removal and clean up

Some small changes to clean up the external interface (ed69208, b478a23, 6272cfe), bring the code inline with the documented authentication API (c4ce285) and make better use of `request` (3894771).