Checkpoint for sync/async refactor.

Various changes to support async adapter (tornado).