Merging refactoringbuildindex into master

This covers all the changes for allowing avherald to exist alongside the Wikipedia history code (although avherald is still in a separate branch as of now). There is a lot of refactoring and a new system for doing span replacements in description HTML.