Ignore empty input
Add quit command and use it when signalled to quit
Improved connection code
Added disconnect command