Async javascript using generators