Stop and reset app

Can almost relaunch app after stopping. Also cleaned functions.