Added handlers and split up functionality.

This small patch adds handlers for various events in the icecast main
loop. This should allow for easier integration with other services.

The patch also splits up some of the client switching logic up into
extra methods. This should make it easier to add extra functionality at
a later point since we aren't dependant on the removal of a client for
switching anymore.