Add tests for async push, refactor thread logic