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, 0433d0d) and make better use of `request` (3894771, dd7cb48).