lightirc: some more fixes

* cleanup code
* fix some more obscure bugs