Added an ok-ish login functionality but there are still a bunch of bugs.