Added global state management for long operations and switched WHOIS to use it