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

Cancel and replace PR#320
What does `ctr` stand for? Could you please comment here to explain what you're testing?