Restructure, encryption and event listener

Restructured. Added encryption on entire stream. You can listen on the 'login_success' event and receive the username + uuid on logins (uuid not populated yet)