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