[examples] app1: make use of ctor/dtor instead of putting everything into run()