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

Cancel and replace PR#320
It could, but I'm pretty sure that tests will diverge over time and both `generator_func` take different parameters so it adds extra complexity.