Added register and login functionality. 
Not sure if this works properly yet.