Added registration functionality to main.js. Not working ATM