Added function for joining channels (it doesn't get called yet) and some other things.