Made token replacements perform two passes so that tokens can be used in .js files.