Much work towards #8107.  The templates are mostly in place now.