lightirc: multiple bug fixes

* fix hang when trying to part
* remove tabs when actually parted so ZNC parts now work
* also cleanup code