refactor main.js to move login into the viewModels