Combine async and timer modules into single env module

Consolidate platform sniffing into one module, and refactor for more readability.

See #378.