add toString to CdmSource and cleanup and some minor fixes