Updated to better use shared app, improved settings, and better debug handling