Move main logic out to seperate js file. Early ui setup.