Added thread/loop cleanup so we can finally reload without killing the whole bot.