Refactor to node async format
Add setTimeout to simulate async
Refactor tests for async execution