Refactor some client codepaths, switching to state machines

Summary:
Feature: Async Client

This is preparatory work for making these codepaths usable in an async
context.  The goal is to represent the same state machine (async or
sync) via the context structure and calling function pointers that make
use of the context's data to perform io, handle results, etc.

This splits the connect codepaths into smaller units (generally
separating at the IO boundaries).  It changes the mechanism for
executing the connect sequence to mimic what the async version will do.

It also makes a state machine for the authentication flow, similar to
the connect flow -- breaking it apart at the IO points.

This doesn't change the plugin portion yet, but does make the rest of it
state machine'd.

Test Plan: mtr

Reviewers: inaam-rana, darnaut, chip, pivanof

Reviewed By: pivanof

Subscribers: aran112000, methane, steaphan, atcurtis, chip, liang.guo.752, andrew-ford, jeremycole, flamingcow, MarkCallaghan, jtolmer

Differential Revision: https://reviews.facebook.net/D17025