Rewrote module to be async.

Squashed.