Flatten red links in JavaScript

This will speed up processing time of mobile pages drastically
according to Max.

This does introduce a flash of unstyled content as red links are
flattened but I think this is acceptable.

Links are only flattened for stable users and anonymous users in beta/alpha/stable
like before

Change-Id: I6f4c6fe1e7bc259ab101e6d6635771cec18be814
Merge "Flatten red links in JavaScript"