Improved version of the previous patch. Should update all the templates for all the styles, and handles 404s appropriately. I'd appreciate a close look at the template edits in particular, as it feels likely that I missed something.