Implement key exchange and encryption
Fix some UI event issues and a little refactor.
Make it pretty