lightirc: fix some bugs and cleanup

* fix a few subtle bugs that creeped in :)
* cleanup dead code and merge methods