Moving the Facebook javascript to main.js and checking login when loading the page.