Moved some class methods to instance methods, added session model, added e-mail sending and storing session token in cookie