Build lang prefixes list once in removeLanguageLinks()
Instead of just checking whether validLanguageLinks() is
empty, it will build a list of language prefixes (including
the obsolete ones) once and then reuses that list to remove
all links which use one of the prefixes.
This indirectly reduces the runtime as it'll won't call
validLanguageLinks() twice if it's not empty.