Move "global" code to main.js file
Make it possible to login to server