Add :app option to the component generator, fixes #1567

ref #1567 
@systematicfrank Could you try this changes?