Properly return app instance now
Added basic explanation for the javascript part