Make Basic Auth base64 encoding asynchronous.
Also, fix everything.