Remove dependency on setTimeout global.