Improving the add-ons generator to deal with apps (bug 1080145)

Cancel and replace PR#320
Could this also be based on `_BaseAddonGeneratorTests` if it takes an additional `generator_func` attribute or something?