Moved console client logic from the library to the right place.