Clean up of different types of clients.
updated core lib for better use in apps (i.e. less dependant on daemon lib