Rewrote login, registration code. Login logout now works