Moved logout functionality to main.js