Finished login, Fixed register

TODO: login can be smarter.