Added license and function wrapper to app.js