fixing public/app.js errors, adding in logout functionality as well as auth checking for pages