Implemented login and chat longpolling. Security and optimization remains.