Factored out initializeTokenGenerator() from main.