Removed needless curses dependency
Improved CLOSE handshake implementation, it should work now...
Added missing close() method, typing bugfix, removed debug code